X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvat2%2Ftest%2Fvat2_test.c;h=b5346eeea47c2625eea586d737c7a1fc9c165f13;hp=fe788f127c6b3a5f7a57bd1e7472fb78e0df53dc;hb=fb0afab7f;hpb=c25882c28e081bf6a2bd4e914ac85f6e4edbfc3d diff --git a/src/vat2/test/vat2_test.c b/src/vat2/test/vat2_test.c index fe788f127c6..b5346eeea47 100644 --- a/src/vat2/test/vat2_test.c +++ b/src/vat2/test/vat2_test.c @@ -96,24 +96,38 @@ runtest (char *s, bool should_fail) } struct msgs msgs[] = { -{ - .name = "test_prefix", - .tojson = (tojson_fn_t)vl_api_test_prefix_t_tojson, - .fromjson = (fromjson_fn_t)vl_api_test_prefix_t_fromjson, -}, -{ - .name = "test_enum", - .tojson = (tojson_fn_t)vl_api_test_enum_t_tojson, - .fromjson = (fromjson_fn_t)vl_api_test_enum_t_fromjson, -}, + { + .name = "test_prefix", + .tojson = (tojson_fn_t) vl_api_test_prefix_t_tojson, + .fromjson = (fromjson_fn_t) vl_api_test_prefix_t_fromjson, + }, + { + .name = "test_enum", + .tojson = (tojson_fn_t) vl_api_test_enum_t_tojson, + .fromjson = (fromjson_fn_t) vl_api_test_enum_t_fromjson, + }, + { + .name = "test_string", + .tojson = (tojson_fn_t) vl_api_test_string_t_tojson, + .fromjson = (fromjson_fn_t) vl_api_test_string_t_fromjson, + }, + { + .name = "test_string2", + .tojson = (tojson_fn_t) vl_api_test_string2_t_tojson, + .fromjson = (fromjson_fn_t) vl_api_test_string2_t_fromjson, + }, }; struct tests tests[] = { - {.s = "{\"_msgname\": \"test_prefix\", \"pref\": \"2001:db8::/64\"}"}, - {.s = "{\"_msgname\": \"test_prefix\", \"pref\": \"192.168.10.0/24\"}"}, - {.s = "{\"_msgname\": \"test_enum\", \"flags\": [\"RED\", \"BLUE\"]}"}, - {.s = "{\"_msgname\": \"test_enum\", \"flags\": [\"BLACK\", \"BLUE\"]}", - .should_fail = 1}, + { .s = "{\"_msgname\": \"test_prefix\", \"pref\": \"2001:db8::/64\"}" }, + { .s = "{\"_msgname\": \"test_prefix\", \"pref\": \"192.168.10.0/24\"}" }, + { .s = "{\"_msgname\": \"test_enum\", \"flags\": [\"RED\", \"BLUE\"]}" }, + { .s = "{\"_msgname\": \"test_enum\", \"flags\": [\"BLACK\", \"BLUE\"]}", + .should_fail = 1 }, + { .s = "{\"_msgname\": \"test_string\", \"str\": {\"str\": \"Test string " + "type\"}}" }, + { .s = + "{\"_msgname\": \"test_string2\", \"str\": \"Test string toplevel\"}" }, }; int main (int argc, char **argv)