vat2: jsonconvert return checking - coverity
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I8348645927519800d2390d27e01fae612602a6eb
diff --git a/src/vat2/test/vat2_test.api b/src/vat2/test/vat2_test.api
index afc8afa..6d21155 100644
--- a/src/vat2/test/vat2_test.api
+++ b/src/vat2/test/vat2_test.api
@@ -14,6 +14,7 @@
*/
import "vnet/ip/ip_types.api";
+import "vnet/interface_types.api";
autoreply define test_prefix {
vl_api_prefix_t pref;
@@ -94,3 +95,8 @@
u32 client_index;
u32 context;
};
+
+/* Interface */
+autoreply define test_interface {
+ vl_api_interface_index_t sw_if_index;
+};
diff --git a/src/vat2/test/vat2_test.c b/src/vat2/test/vat2_test.c
index 89714c4..1ac4652 100644
--- a/src/vat2/test/vat2_test.c
+++ b/src/vat2/test/vat2_test.c
@@ -162,6 +162,11 @@
.tojson = (tojson_fn_t) vl_api_test_empty_t_tojson,
.fromjson = (fromjson_fn_t) vl_api_test_empty_t_fromjson,
},
+ {
+ .name = "test_interface",
+ .tojson = (tojson_fn_t) vl_api_test_interface_t_tojson,
+ .fromjson = (fromjson_fn_t) vl_api_test_interface_t_fromjson,
+ },
};
struct tests tests[] = {
@@ -190,6 +195,7 @@
{ .s = "{\"_msgname\": \"test_addresses3\", \"n\": 2, \"a\": "
"[\"2001:db8::23\", \"2001:db8::23\"] }" },
{ .s = "{\"_msgname\": \"test_empty\"}" },
+ { .s = "{\"_msgname\": \"test_interface\", \"sw_if_index\": 100 }" },
};
int main (int argc, char **argv)