[libvirt] [PATCH 4/5] Test parsing of large numbers in JSON

Ján Tomko posted 5 patches 7 years, 5 months ago
[libvirt] [PATCH 4/5] Test parsing of large numbers in JSON
Posted by Ján Tomko 7 years, 5 months ago
We expect to get numbers as big as ULLONG_MAX from QEMU,
add a test for them.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tests/virjsontest.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/virjsontest.c b/tests/virjsontest.c
index 195d8279f0..baf1070c5a 100644
--- a/tests/virjsontest.c
+++ b/tests/virjsontest.c
@@ -589,6 +589,9 @@ mymain(void)
     DO_TEST_PARSE("float without garbage", "[ 1.024e19 ]", "[1.024e19]");
     DO_TEST_PARSE_FAIL("float with garbage", "[ 0.0314159ee+100 ]");
 
+    DO_TEST_PARSE("unsigned minus one", "[ 18446744073709551615 ]", "[18446744073709551615]");
+    DO_TEST_PARSE("another big number", "[ 9223372036854775808 ]", "[9223372036854775808]");
+
     DO_TEST_PARSE("string", "[ \"The meaning of life\" ]",
                   "[\"The meaning of life\"]");
     DO_TEST_PARSE_FAIL("unterminated string", "[ \"The meaning of lif ]");
-- 
2.16.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 4/5] Test parsing of large numbers in JSON
Posted by Daniel P. Berrangé 7 years, 5 months ago
On Tue, Aug 28, 2018 at 12:22:54PM +0200, Ján Tomko wrote:
> We expect to get numbers as big as ULLONG_MAX from QEMU,
> add a test for them.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  tests/virjsontest.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list