X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fext%2Fvapi_c_test.c;fp=test%2Fext%2Fvapi_test.c;h=622b617b3942648d19d9ab197692b3251d32f4d9;hb=dc15be2ca7c51772b00e4c5548934a35aa7e4add;hp=eca6be7d6cce02e3f5784dda200614cdd32fdca4;hpb=9d063047eb1a3738cb0fc9ebebb55793d155bb20;p=vpp.git diff --git a/test/ext/vapi_test.c b/test/ext/vapi_c_test.c similarity index 97% rename from test/ext/vapi_test.c rename to test/ext/vapi_c_test.c index eca6be7d6cc..622b617b394 100644 --- a/test/ext/vapi_test.c +++ b/test/ext/vapi_c_test.c @@ -22,16 +22,18 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include DEFINE_VAPI_MSG_IDS_VPE_API_JSON; DEFINE_VAPI_MSG_IDS_INTERFACE_API_JSON; DEFINE_VAPI_MSG_IDS_L2_API_JSON; DEFINE_VAPI_MSG_IDS_STATS_API_JSON; +DEFINE_VAPI_MSG_IDS_FAKE_API_JSON; static char *app_name = NULL; static char *api_prefix = NULL; @@ -521,9 +523,8 @@ START_TEST (test_show_version_1) size_t size; rv = vapi_recv (ctx, (void *) &resp, &size); ck_assert_int_eq (VAPI_OK, rv); - vapi_payload_show_version_reply *payload = &resp->payload; int dummy; - show_version_cb (NULL, &dummy, VAPI_OK, true, payload); + show_version_cb (NULL, &dummy, VAPI_OK, true, &resp->payload); vapi_msg_free (ctx, resp); } @@ -1069,6 +1070,16 @@ START_TEST (test_no_response_2) } END_TEST; + +START_TEST (test_unsupported) +{ + printf ("--- Unsupported messages ---\n"); + bool available = vapi_is_msg_available (ctx, vapi_msg_id_test_fake_msg); + ck_assert_int_eq (false, available); +} + +END_TEST; + Suite * test_suite (void) { @@ -1115,6 +1126,11 @@ test_suite (void) tcase_add_test (tc_nonblock, test_no_response_2); suite_add_tcase (s, tc_nonblock); + TCase *tc_unsupported = tcase_create ("Unsupported message"); + tcase_add_checked_fixture (tc_unsupported, setup_blocking, teardown); + tcase_add_test (tc_unsupported, test_unsupported); + suite_add_tcase (s, tc_unsupported); + return s; }