summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2014-06-30 11:52:55 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-07-01 16:25:36 +0200
commit8d9645381343b66aec2e8e2c71efc3cb9c9a098d (patch)
tree6750538556854a693642b54c84ac3de3437e0b92
parentcf953d2bfa7df9aa67459b333db4d4d8a9e72fd6 (diff)
downloaddpdk-8d9645381343b66aec2e8e2c71efc3cb9c9a098d.zip
dpdk-8d9645381343b66aec2e8e2c71efc3cb9c9a098d.tar.gz
dpdk-8d9645381343b66aec2e8e2c71efc3cb9c9a098d.tar.xz
app/test: remove writes in NULL buffer from cmdline tests
Cmdline unit test calls several functions that use snprintf, with NULL pointer as the destination buffer. This patch eliminates these NULL pointer tests. Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Waterman Cao <waterman.cao@intel.com>
-rw-r--r--app/test/test_cmdline_etheraddr.c7
-rw-r--r--app/test/test_cmdline_num.c7
-rw-r--r--app/test/test_cmdline_portlist.c7
3 files changed, 0 insertions, 21 deletions
diff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c
index 21f5863..45c61ff 100644
--- a/app/test/test_cmdline_etheraddr.c
+++ b/app/test/test_cmdline_etheraddr.c
@@ -161,13 +161,6 @@ test_parse_etheraddr_invalid_param(void)
/* test help function */
memset(&buf, 0, sizeof(buf));
- /* try null buf */
- ret = cmdline_get_help_etheraddr(NULL, NULL, sizeof(buf));
- if (ret != -1) {
- printf("Error: help function accepted null buffer!\n");
- return -1;
- }
-
/* coverage! */
ret = cmdline_get_help_etheraddr(NULL, buf, sizeof(buf));
if (ret < 0) {
diff --git a/app/test/test_cmdline_num.c b/app/test/test_cmdline_num.c
index e865428..799d68c 100644
--- a/app/test/test_cmdline_num.c
+++ b/app/test/test_cmdline_num.c
@@ -395,13 +395,6 @@ test_parse_num_invalid_param(void)
return -1;
}
- /* try null buf */
- ret = cmdline_get_help_num((cmdline_parse_token_hdr_t*)&token, NULL, sizeof(buf));
- if (ret != -1) {
- printf("Error: help function accepted null buffer!\n");
- return -1;
- }
-
/* coverage! */
ret = cmdline_get_help_num((cmdline_parse_token_hdr_t*)&token, buf, sizeof(buf));
if (ret < 0) {
diff --git a/app/test/test_cmdline_portlist.c b/app/test/test_cmdline_portlist.c
index abba008..9f9633c 100644
--- a/app/test/test_cmdline_portlist.c
+++ b/app/test/test_cmdline_portlist.c
@@ -164,13 +164,6 @@ test_parse_portlist_invalid_param(void)
/* test help function */
- /* try null buf */
- ret = cmdline_get_help_portlist(NULL, NULL, sizeof(buf));
- if (ret != -1) {
- printf("Error: help function accepted null buffer!\n");
- return -1;
- }
-
/* coverage! */
ret = cmdline_get_help_portlist(NULL, buf, sizeof(buf));
if (ret < 0) {