From patchwork Sat Jun 23 09:15:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 386 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.27.255.8]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id uxcVEZycLlssTgAAIUCqbw for ; Sat, 23 Jun 2018 15:16:44 -0400 Received: from proxy11.mail.iad3a.rsapps.net ([172.27.255.8]) by director7.mail.ord1d.rsapps.net (Dovecot) with LMTP id g6FpC5ycLlvUYQAAovjBpQ ; Sat, 23 Jun 2018 15:16:44 -0400 Received: from smtp12.gate.iad3a ([172.27.255.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3a.rsapps.net with LMTP id eEGhCZycLlvbewAAxCvdqw ; Sat, 23 Jun 2018 15:16:44 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp12.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: f69a3b9a-7719-11e8-94be-525400068c1c-1-1 Received: from [216.105.38.7] ([216.105.38.7:4627] helo=lists.sourceforge.net) by smtp12.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EF/97-31026-B9C9E2B5; Sat, 23 Jun 2018 15:16:43 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fWo0m-0007Pl-DV; Sat, 23 Jun 2018 19:15:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fWo0k-0007Pe-Rw for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 19:15:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cnKI3IgfFMofbpt2QxRyqEUyTWI0G4r40VtqgQz0O3w=; b=VuEVETu4R0X+dDStlCSGdclsqM pCCSFGnDXwBXUn/d2hVqBOjYbvoCMzw3RrtmhvV6AHMor93kV64WnDJd+fyssmAHMMsll9TP7l3WT N6QeVa2qSiPBQTwNtr3eiFmbCgNtqvLvrbLesHVAdIQQbNbb+JQR/iLMQV64lTvPZL/0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cnKI3IgfFMofbpt2QxRyqEUyTWI0G4r40VtqgQz0O3w=; b=m8CpHydJyYgOvVFikwdkgR5J5a 8qT0dSPgV7xMKe1M7cBxJUG3chonDXR5YRoLyx9HEb1iLnFU+zJLXinU7Zhc9aDWWe7y9b/8iG003 BL6gurLLehsXGr+n1ZYfayttqmBCsUu6aQAFvve032dpRNVqiWpQvgQuh0kpTGYOti98=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fWo0i-001E69-Pz for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 19:15:50 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.14.9/8.14.9) with ESMTP id w5NJFgQY029363 for ; Sat, 23 Jun 2018 21:15:42 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.14.9/8.14.9/Submit) id w5NJFg2F029362 for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 21:15:42 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sat, 23 Jun 2018 21:15:38 +0200 Message-Id: <20180623191538.29317-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: References: X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1fWo0i-001E69-Pz Subject: [Openvpn-devel] [PATCH v3] Add %d, %u and %lu tests to test_argv unit tests. X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Some basic integer tests to verify signed, unsigned and long unsigned (1L) printing. Signed-off-by: Gert Doering Signed-off-by: Gert Doering <gert@greenie.muc.de>
--- v2: test %lu with "1" as windows and linux/i386 do not have 64 bit long v3: fix 2^33 in commit message, use "1L" for proper data type (Selva) --- tests/unit_tests/openvpn/test_argv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit_tests/openvpn/test_argv.c b/tests/unit_tests/openvpn/test_argv.c index 4a3ba559..0fdd3f0a 100644 --- a/tests/unit_tests/openvpn/test_argv.c +++ b/tests/unit_tests/openvpn/test_argv.c @@ -116,8 +116,12 @@ argv_str__multiple_argv__correct_output(void **state) argv_printf(&a, "%s%sc", PATH1, PATH2); argv_printf_cat(&a, "%s", PARAM1); argv_printf_cat(&a, "%s", PARAM2); + argv_printf_cat(&a, "%d", -1); + argv_printf_cat(&a, "%u", -1); + argv_printf_cat(&a, "%lu", 1L ); output = argv_str(&a, &gc, PA_BRACKET); - assert_string_equal(output, "[" PATH1 PATH2 "] [" PARAM1 "] [" PARAM2 "]"); + assert_string_equal(output, "[" PATH1 PATH2 "] [" PARAM1 "] [" PARAM2 "]" + " [-1] [4294967295] [1]"); argv_reset(&a); gc_free(&gc);