dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
To: Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH 2/3] test: remove no longer valid tests
Date: Tue, 24 Jun 2014 09:03:45 -0700	[thread overview]
Message-ID: <20140624090345.6b568f4f@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20140624090253.140206a7-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>

Since GCC catches calling snprintf() with NULL argument at compile time
(which is even better). These string function tests are unnecessary
and no longer compile.

Signed-off-by: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>

--- a/app/test/test_string_fns.c	2014-06-24 08:48:52.558007950 -0700
+++ b/app/test/test_string_fns.c	2014-06-24 08:48:52.558007950 -0700
@@ -149,32 +149,6 @@ test_snprintf(void)
 			return -1;
 		}
 
-		memset(buf, DATA_BYTE, sizeof(buf));
-		/* call with a NULL format and zero-size should return error
-		 * without affecting the buffer */
-		if (snprintf(buf, 0, NULL) != -1 ||
-				errno != EINVAL) {
-			LOG("Failed to get suitable error when passing NULL buffer\n");
-			return -1;
-		}
-		if (buf[0] != DATA_BYTE) {
-			LOG("Error, zero-length buffer modified after call with NULL"
-					" format string\n");
-			return -1;
-		}
-
-		/* call with a NULL format should return error but also null-terminate
-		 *  the buffer */
-		if (snprintf(buf, sizeof(buf), NULL) != -1 ||
-				errno != EINVAL) {
-			LOG("Failed to get suitable error when passing NULL buffer\n");
-			return -1;
-		}
-		if (buf[0] != '\0') {
-			LOG("Error, buffer not null-terminated after call with NULL"
-					" format string\n");
-			return -1;
-		}
 	} while (0);
 
 	LOG("%s - PASSED\n", __func__);

  parent reply	other threads:[~2014-06-24 16:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 16:02 [PATCH 1/3] stringfns: remove rte_snprintf Stephen Hemminger
     [not found] ` <20140624090253.140206a7-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2014-06-24 16:03   ` Stephen Hemminger [this message]
2014-06-24 16:05   ` [PATCH 3/3] fix incorrect snprintf usage Stephen Hemminger
2014-06-24 17:39   ` [PATCH 1/3] stringfns: remove rte_snprintf Richardson, Bruce
     [not found]     ` <59AF69C657FD0841A61C55336867B5B02CEE3359-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-24 17:54       ` Stephen Hemminger
     [not found]         ` <20140624105427.166c21bf-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2014-06-24 18:00           ` Richardson, Bruce
     [not found]             ` <59AF69C657FD0841A61C55336867B5B02CEE345B-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-25  7:55               ` Olivier MATZ
2014-06-25  8:33       ` Thomas Monjalon
2014-06-26 15:09         ` Richardson, Bruce
     [not found]           ` <59AF69C657FD0841A61C55336867B5B02CEF87D2-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-26 16:20             ` Aaron Campbell
     [not found]               ` <5590E373-EC37-4544-A983-52156CFA81E2-rd7evPjynkNeoWH0uzbU5w@public.gmane.org>
2014-06-27  0:37                 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140624090345.6b568f4f@nehalam.linuxnetplumber.net \
    --to=stephen-otpzqlsittunbdjkjebofr2eb7je58tq@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).