DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test
@ 2014-06-30 10:52 Pablo de Lara
  2014-06-30 11:34 ` Olivier MATZ
  2014-07-01  8:49 ` Cao, Waterman
  0 siblings, 2 replies; 4+ messages in thread
From: Pablo de Lara @ 2014-06-30 10:52 UTC (permalink / raw)
  To: dev

From: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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>
---
 app/test/test_cmdline_etheraddr.c |    7 -------
 app/test/test_cmdline_num.c       |    7 -------
 app/test/test_cmdline_portlist.c  |    7 -------
 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) {
-- 
1.7.0.7

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test
  2014-06-30 10:52 [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test Pablo de Lara
@ 2014-06-30 11:34 ` Olivier MATZ
  2014-07-01 22:09   ` Thomas Monjalon
  2014-07-01  8:49 ` Cao, Waterman
  1 sibling, 1 reply; 4+ messages in thread
From: Olivier MATZ @ 2014-06-30 11:34 UTC (permalink / raw)
  To: Pablo de Lara, dev

Hello Pablo,

On 06/30/2014 12:52 PM, Pablo de Lara wrote:
> From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
>
> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test
  2014-06-30 10:52 [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test Pablo de Lara
  2014-06-30 11:34 ` Olivier MATZ
@ 2014-07-01  8:49 ` Cao, Waterman
  1 sibling, 0 replies; 4+ messages in thread
From: Cao, Waterman @ 2014-07-01  8:49 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev

Tested-by: Waterman Cao <waterman.cao@intel.com>

This patch updated Cmdline unit test, and is ready to integrate into DPDK.org.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test
  2014-06-30 11:34 ` Olivier MATZ
@ 2014-07-01 22:09   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-07-01 22:09 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev

> > 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>

Applied for version 1.7.0.

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-01 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 10:52 [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test Pablo de Lara
2014-06-30 11:34 ` Olivier MATZ
2014-07-01 22:09   ` Thomas Monjalon
2014-07-01  8:49 ` Cao, Waterman

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git