From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, tao3.xu@intel.com
Subject: [PATCH 2/2] test-keyval: Tighten test of trailing crap after size
Date: Mon, 25 Nov 2019 14:38:46 +0100 [thread overview]
Message-ID: <20191125133846.27790-3-armbru@redhat.com> (raw)
In-Reply-To: <20191125133846.27790-1-armbru@redhat.com>
test_keyval_visit_size() should test for trailing crap after size with
and without suffix. It does test the latter: "sz2=16Gi" has size
"16G" followed by crap "i". It fails to test the former "sz1=16E" is
a syntactically valid size that overflows uint64_t. Replace by
"sz1=0Z".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/test-keyval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-keyval.c b/tests/test-keyval.c
index 09b0ae3c68..e331a84149 100644
--- a/tests/test-keyval.c
+++ b/tests/test-keyval.c
@@ -478,7 +478,7 @@ static void test_keyval_visit_size(void)
visit_free(v);
/* Trailing crap */
- qdict = keyval_parse("sz1=16E,sz2=16Gi", NULL, &error_abort);
+ qdict = keyval_parse("sz1=0Z,sz2=16Gi", NULL, &error_abort);
v = qobject_input_visitor_new_keyval(QOBJECT(qdict));
qobject_unref(qdict);
visit_start_struct(v, NULL, NULL, 0, &error_abort);
--
2.21.0
next prev parent reply other threads:[~2019-11-25 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-25 13:38 [PATCH 0/2] Minor integer parsing improvements Markus Armbruster
2019-11-25 13:38 ` [PATCH 1/2] util/cutils: Turn FIXME comment into QEMU_BUILD_BUG_ON() Markus Armbruster
2019-11-25 14:17 ` Philippe Mathieu-Daudé
2019-11-25 13:38 ` Markus Armbruster [this message]
2019-11-25 14:29 ` [PATCH 2/2] test-keyval: Tighten test of trailing crap after size Eric Blake
2019-11-25 15:31 ` Markus Armbruster
2019-11-25 16:25 ` Eric Blake
2019-12-18 11:29 ` Laurent Vivier
2019-11-25 21:33 ` [PATCH 0/2] Minor integer parsing improvements no-reply
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=20191125133846.27790-3-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=tao3.xu@intel.com \
/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).