| Message ID | 20180623181530.19484-1-gert@greenie.muc.de |
|---|---|
| State | Changes Requested |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.27.255.55]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id baUoAYmOLlsnFwAAIUCqbw for <patchwork@openvpn.net>; Sat, 23 Jun 2018 14:16:41 -0400 Received: from proxy9.mail.iad3a.rsapps.net ([172.27.255.55]) by director12.mail.ord1d.rsapps.net (Dovecot) with LMTP id +YesAImOLlu4AwAAIasKDg ; Sat, 23 Jun 2018 14:16:41 -0400 Received: from smtp28.gate.iad3a ([172.27.255.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.iad3a.rsapps.net with LMTP id IF8/N4iOLltaJwAAGuSQww ; Sat, 23 Jun 2018 14:16:40 -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: smtp28.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: 917a44a6-7711-11e8-a1fc-52540000591c-1-1 Received: from [216.105.38.7] ([216.105.38.7:63842] helo=lists.sourceforge.net) by smtp28.gate.iad3a.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EE/7D-23614-68E8E2B5; Sat, 23 Jun 2018 14:16:38 -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 <openvpn-devel-bounces@lists.sourceforge.net>) id 1fWn4X-0006Yn-KT; Sat, 23 Jun 2018 18:15:41 +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 <gert@blue.greenie.muc.de>) id 1fWn4W-0006Yh-LX for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 18:15:40 +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=mTqoAChZlxaQGEB4uZ9ZqMKz1bOLL+bQiSk+YNPbgpE=; b=EBoNqZr11OO4xdBOMiD+ywdsYX HwaLOvQjTI5KClaQTqXWHB0FL6RaWYLLHixDnD/1LzsGE8N0qL1WFN9GdGWR4FFBUG6iFQvfBbdbG /0tPu/5sFlgCdp37t0VdFJBTxaxpeN6L70EYPFm+zF+McbPKpExZX1VLVaJtWCiiHRyA=; 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=mTqoAChZlxaQGEB4uZ9ZqMKz1bOLL+bQiSk+YNPbgpE=; b=iHwqu+eyC+/JEf66uXfTKIL7vD Etqe3KJ+Sw3vTNUJtEAGYrkatfyOsm0wo+ON/BqQv30K6djs7qwcAySYDZ1X2VfuegMqviAJaSO96 IDvbiJizghtsDw5bwLlqnKI3uyBusHT3jCxGC5yqIV/LfDJXIoJpqVsmUhl6WXO8CEWc=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fWn4U-004M3d-4g for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 18:15:40 +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 w5NIFVCw019530 for <openvpn-devel@lists.sourceforge.net>; Sat, 23 Jun 2018 20:15:31 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.14.9/8.14.9/Submit) id w5NIFV8g019529 for openvpn-devel@lists.sourceforge.net; Sat, 23 Jun 2018 20:15:31 +0200 From: Gert Doering <gert@greenie.muc.de> To: openvpn-devel@lists.sourceforge.net Date: Sat, 23 Jun 2018 20:15:30 +0200 Message-Id: <20180623181530.19484-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180623173104.GT57262@greenie.muc.de> References: <20180623173104.GT57262@greenie.muc.de> 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: 1fWn4U-004M3d-4g Subject: [Openvpn-devel] [PATCH v2] 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: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel,v2] Add %d, %u and %lu tests to test_argv unit tests.
|
|
Commit Message
Gert Doering
June 23, 2018, 8:15 a.m. UTC
Some basic integer tests to verify signed, unsigned and
long unsigned (2^33) printing.
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
---
tests/unit_tests/openvpn/test_argv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
Hi, This is good enough, but (there is always a but :) On Sat, Jun 23, 2018 at 2:15 PM, Gert Doering <gert@greenie.muc.de> wrote: > Some basic integer tests to verify signed, unsigned and > long unsigned (2^33) printing. > That 2^33 still lurking in the commit message could go.. > > 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 > --- > 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..202a8ff5 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", 1 ); > This triggers a -Wformat warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘in’ [-Wformat=] Suggest 1L instead of 1. > 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); > ACK otherwise. Good luck with the game. Selva <div dir="ltr">Hi,<br><div class="gmail_extra"><br></div><div class="gmail_extra">This is good enough, but (there is always a but :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 23, 2018 at 2:15 PM, Gert Doering <span dir="ltr"><<a href="mailto:gert@greenie.muc.de" target="_blank">gert@greenie.muc.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>Some basic integer tests to verify signed, unsigned and<br> long unsigned (2^33) printing.<br></span></blockquote><div><br></div><div>That 2^33 still lurking in the commit message could go..</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span> <br> </span>Signed-off-by: Gert Doering <<a href="mailto:gert@greenie.muc.de" target="_blank">gert@greenie.muc.de</a>><br> --<br> v2: test %lu with "1" as windows and linux/i386 do not have 64 bit long<br> <span>---<br> tests/unit_tests/openvpn/<wbr>test_argv.c | 6 +++++-<br> 1 file changed, 5 insertions(+), 1 deletion(-)<br> <br> diff --git a/tests/unit_tests/openvpn/tes<wbr>t_argv.c b/tests/unit_tests/openvpn/tes<wbr>t_argv.c<br> </span>index 4a3ba559..202a8ff5 100644<br> <span>--- a/tests/unit_tests/openvpn/tes<wbr>t_argv.c<br> +++ b/tests/unit_tests/openvpn/tes<wbr>t_argv.c<br> @@ -116,8 +116,12 @@ argv_str__multiple_argv__corre<wbr>ct_output(void **state)<br> argv_printf(&a, "%s%sc", PATH1, PATH2);<br> argv_printf_cat(&a, "%s", PARAM1);<br> argv_printf_cat(&a, "%s", PARAM2);<br> + argv_printf_cat(&a, "%d", -1);<br> + argv_printf_cat(&a, "%u", -1);<br> </span>+ argv_printf_cat(&a, "%lu", 1 );<br></blockquote><div><br></div><div>This triggers a -Wformat warning:</div><div> </div><div>format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘in’ [-Wformat=]<br></div><div><br></div><div>Suggest 1L instead of 1.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <span> output = argv_str(&a, &gc, PA_BRACKET);<br> - assert_string_equal(output, "[" PATH1 PATH2 "] [" PARAM1 "] [" PARAM2 "]");<br> + assert_string_equal(output, "[" PATH1 PATH2 "] [" PARAM1 "] [" PARAM2 "]"<br> </span>+ " [-1] [4294967295] [1]"); </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div class="gmail-m_3288186890819326676HOEnZb"><div class="gmail-m_3288186890819326676h5"> <br> argv_reset(&a);<br> gc_free(&gc);<br></div></div></blockquote><div><br></div><div>ACK otherwise.</div><div><br></div><div>Good luck with the game.</div><div><br></div><div>Selva</div></div></div></div> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
diff --git a/tests/unit_tests/openvpn/test_argv.c b/tests/unit_tests/openvpn/test_argv.c index 4a3ba559..202a8ff5 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", 1 ); 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);