aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/vlib_test.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-12-09 10:45:47 -0500
committerFlorin Coras <florin.coras@gmail.com>2019-12-09 21:19:47 +0000
commit6b3f25caff262b536a5449ac5461dd041c92a655 (patch)
tree89b0440162675b6ec4650cc30ec6908be84abb18 /src/plugins/unittest/vlib_test.c
parent5224b5cbd51ed48d1d2ce2a412998d8a944c480b (diff)
vlib: improve test coverage
Add tests. Remove unused rule-based parser code. Type: test Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3ca3a9dd9da8ee8f3a47004c98f2f5644db10057
Diffstat (limited to 'src/plugins/unittest/vlib_test.c')
-rw-r--r--src/plugins/unittest/vlib_test.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/plugins/unittest/vlib_test.c b/src/plugins/unittest/vlib_test.c
index 49c2ef20052..3154b7d21cf 100644
--- a/src/plugins/unittest/vlib_test.c
+++ b/src/plugins/unittest/vlib_test.c
@@ -133,7 +133,7 @@ test_vlib_command_fn (vlib_main_t * vm,
VLIB_CLI_COMMAND (test_vlib_command, static) =
{
.path = "test vlib",
- .short_help = "vlib code coverate unit test",
+ .short_help = "vlib code coverage unit test",
.function = test_vlib_command_fn,
};
/* *INDENT-ON* */
@@ -189,6 +189,45 @@ VLIB_CLI_COMMAND (test_format_vlib_command, static) =
};
/* *INDENT-ON* */
+static clib_error_t *
+test_vlib2_command_fn (vlib_main_t * vm,
+ unformat_input_t * input, vlib_cli_command_t * cmd)
+{
+ u8 *s;
+ u8 **result;
+
+ s = format (0, "show ");
+ result = vlib_cli_get_possible_completions (s);
+ vec_free (result);
+ vec_free (s);
+
+ s = 0;
+ vec_add1 (s, 0);
+ result = vlib_cli_get_possible_completions (s);
+ vec_free (result);
+ vec_free (s);
+
+ s = format (0, "show ?");
+ result = vlib_cli_get_possible_completions (s);
+ vec_free (result);
+ vec_free (s);
+
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (test_vlib2_command, static) =
+{
+ .path = "test vlib2",
+ .short_help = "vlib code coverage unit test #2",
+ .function = test_vlib2_command_fn,
+};
+/* *INDENT-ON* */
+
+
+
+
+
/*
* fd.io coding-style-patch-verification: ON
*