From nobody Mon Feb 9 10:29:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487879770020606.1518240488215; Thu, 23 Feb 2017 11:56:10 -0800 (PST) Received: from localhost ([::1]:60688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgzUm-0003IA-QZ for importer@patchew.org; Thu, 23 Feb 2017 14:56:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgzSs-0001xo-Dd for qemu-devel@nongnu.org; Thu, 23 Feb 2017 14:54:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgzSo-0000m3-8E for qemu-devel@nongnu.org; Thu, 23 Feb 2017 14:54:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45450) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgzSn-0000lJ-VZ for qemu-devel@nongnu.org; Thu, 23 Feb 2017 14:54:06 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F93A5145A for ; Thu, 23 Feb 2017 19:54:05 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NJs4TJ020790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 23 Feb 2017 14:54:05 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 875971138650; Thu, 23 Feb 2017 20:54:02 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 23 Feb 2017 20:53:41 +0100 Message-Id: <1487879642-16139-4-git-send-email-armbru@redhat.com> In-Reply-To: <1487879642-16139-1-git-send-email-armbru@redhat.com> References: <1487879642-16139-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 23 Feb 2017 19:54:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/24] test-cutils: Add missing qemu_strtol()... endptr checks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1487708048-2131-4-git-send-email-armbru@redhat.com> --- tests/test-cutils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test-cutils.c b/tests/test-cutils.c index 20b0f59..71681dc 100644 --- a/tests/test-cutils.c +++ b/tests/test-cutils.c @@ -262,6 +262,7 @@ static void test_qemu_strtol_empty(void) err =3D qemu_strtol(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtol_whitespace(void) @@ -275,6 +276,7 @@ static void test_qemu_strtol_whitespace(void) err =3D qemu_strtol(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtol_invalid(void) @@ -288,6 +290,7 @@ static void test_qemu_strtol_invalid(void) err =3D qemu_strtol(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtol_trailing(void) @@ -548,6 +551,7 @@ static void test_qemu_strtoul_empty(void) err =3D qemu_strtoul(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoul_whitespace(void) @@ -561,6 +565,7 @@ static void test_qemu_strtoul_whitespace(void) err =3D qemu_strtoul(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoul_invalid(void) @@ -574,6 +579,7 @@ static void test_qemu_strtoul_invalid(void) err =3D qemu_strtoul(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoul_trailing(void) @@ -829,6 +835,7 @@ static void test_qemu_strtoll_empty(void) err =3D qemu_strtoll(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoll_whitespace(void) @@ -842,6 +849,7 @@ static void test_qemu_strtoll_whitespace(void) err =3D qemu_strtoll(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoll_invalid(void) @@ -855,6 +863,7 @@ static void test_qemu_strtoll_invalid(void) err =3D qemu_strtoll(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoll_trailing(void) @@ -1113,6 +1122,7 @@ static void test_qemu_strtoull_empty(void) err =3D qemu_strtoull(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoull_whitespace(void) @@ -1126,6 +1136,7 @@ static void test_qemu_strtoull_whitespace(void) err =3D qemu_strtoull(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoull_invalid(void) @@ -1139,6 +1150,7 @@ static void test_qemu_strtoull_invalid(void) err =3D qemu_strtoull(str, &endptr, 0, &res); =20 g_assert_cmpint(err, =3D=3D, -EINVAL); + g_assert(endptr =3D=3D str); } =20 static void test_qemu_strtoull_trailing(void) --=20 2.7.4