From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH 2/3] test: remove no longer valid tests Date: Tue, 24 Jun 2014 09:03:45 -0700 Message-ID: <20140624090345.6b568f4f@nehalam.linuxnetplumber.net> References: <20140624090253.140206a7@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Stephen Hemminger Return-path: In-Reply-To: <20140624090253.140206a7-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 --- 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__);