qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

test-string-input-visitor: Add range overflow tests

Let's make sure that the range handling code can properly deal with
ranges that end at the biggest possible number.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181121164421.20780-10-david@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>

authored by

David Hildenbrand and committed by
Markus Armbruster
345e4010 cc871b1c

+10
+10
tests/test-string-input-visitor.c
··· 112 112 int64_t expect2[] = { 32767, -32768, -32767 }; 113 113 int64_t expect3[] = { INT64_MIN, INT64_MAX }; 114 114 int64_t expect4[] = { 1 }; 115 + int64_t expect5[] = { INT64_MAX - 2, INT64_MAX - 1, INT64_MAX }; 115 116 Error *err = NULL; 116 117 int64List *res = NULL; 117 118 Visitor *v; ··· 131 132 132 133 v = visitor_input_test_init(data, "1-1"); 133 134 check_ilist(v, expect4, ARRAY_SIZE(expect4)); 135 + 136 + v = visitor_input_test_init(data, 137 + "9223372036854775805-9223372036854775807"); 138 + check_ilist(v, expect5, ARRAY_SIZE(expect5)); 134 139 135 140 /* Value too large */ 136 141 ··· 216 221 uint64_t expect3[] = { INT64_MIN, INT64_MAX }; 217 222 uint64_t expect4[] = { 1 }; 218 223 uint64_t expect5[] = { UINT64_MAX }; 224 + uint64_t expect6[] = { UINT64_MAX - 2, UINT64_MAX - 1, UINT64_MAX }; 219 225 Error *err = NULL; 220 226 uint64List *res = NULL; 221 227 Visitor *v; ··· 238 244 239 245 v = visitor_input_test_init(data, "18446744073709551615"); 240 246 check_ulist(v, expect5, ARRAY_SIZE(expect5)); 247 + 248 + v = visitor_input_test_init(data, 249 + "18446744073709551613-18446744073709551615"); 250 + check_ulist(v, expect6, ARRAY_SIZE(expect6)); 241 251 242 252 /* Value too large */ 243 253