From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 80E4D333 for ; Mon, 30 Jun 2014 12:52:39 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 30 Jun 2014 03:52:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,574,1400050800"; d="scan'208";a="555205569" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2014 03:52:57 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s5UAquaN003076; Mon, 30 Jun 2014 11:52:56 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s5UAquD6025724; Mon, 30 Jun 2014 11:52:56 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s5UAqugT025720; Mon, 30 Jun 2014 11:52:56 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Mon, 30 Jun 2014 11:52:55 +0100 Message-Id: <1404125575-25691-1-git-send-email-pablox.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] test: Remove NULL snprintf tests in cmdline unit test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 10:52:40 -0000 From: Pablo de Lara 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 --- 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