aboutsummaryrefslogtreecommitdiff
path: root/tests/test-cutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-cutils.c')
-rw-r--r--tests/test-cutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-cutils.c b/tests/test-cutils.c
index c4437d9..f2ecb7a 100644
--- a/tests/test-cutils.c
+++ b/tests/test-cutils.c
@@ -1510,10 +1510,16 @@ static void test_qemu_strtosz_trailing(void)
g_assert_cmpint(res, ==, 123 * M_BYTE);
g_assert(endptr == str + 3);
+ res = qemu_strtosz(str, NULL);
+ g_assert_cmpint(res, ==, -EINVAL);
+
str = "1kiB";
res = qemu_strtosz(str, &endptr);
g_assert_cmpint(res, ==, 1024);
g_assert(endptr == str + 2);
+
+ res = qemu_strtosz(str, NULL);
+ g_assert_cmpint(res, ==, -EINVAL);
}
static void test_qemu_strtosz_erange(void)