aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test-cutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test-cutils.c')
-rw-r--r--tests/unit/test-cutils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/test-cutils.c b/tests/unit/test-cutils.c
index 86caddc..2126b46 100644
--- a/tests/unit/test-cutils.c
+++ b/tests/unit/test-cutils.c
@@ -2315,6 +2315,14 @@ static void test_qemu_strtosz_invalid(void)
g_assert_cmpint(res, ==, 0xbaadf00d);
g_assert(endptr == str);
+ /* No suffixes */
+ str = "0x18M";
+ endptr = NULL;
+ err = qemu_strtosz(str, &endptr, &res);
+ g_assert_cmpint(err, ==, -EINVAL);
+ g_assert_cmpint(res, ==, 0xbaadf00d);
+ g_assert(endptr == str);
+
/* No negative values */
str = "-0";
endptr = NULL;