test-cutils: Add missing qemu_strtol()... endptr checks

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1487708048-2131-4-git-send-email-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2017-02-21 21:13:47 +01:00
parent 8ee8409eff
commit 73245450b3
1 changed files with 12 additions and 0 deletions

View File

@ -262,6 +262,7 @@ static void test_qemu_strtol_empty(void)
err = qemu_strtol(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtol_whitespace(void)
@ -275,6 +276,7 @@ static void test_qemu_strtol_whitespace(void)
err = qemu_strtol(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtol_invalid(void)
@ -288,6 +290,7 @@ static void test_qemu_strtol_invalid(void)
err = qemu_strtol(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtol_trailing(void)
@ -548,6 +551,7 @@ static void test_qemu_strtoul_empty(void)
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoul_whitespace(void)
@ -561,6 +565,7 @@ static void test_qemu_strtoul_whitespace(void)
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoul_invalid(void)
@ -574,6 +579,7 @@ static void test_qemu_strtoul_invalid(void)
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoul_trailing(void)
@ -829,6 +835,7 @@ static void test_qemu_strtoll_empty(void)
err = qemu_strtoll(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoll_whitespace(void)
@ -842,6 +849,7 @@ static void test_qemu_strtoll_whitespace(void)
err = qemu_strtoll(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoll_invalid(void)
@ -855,6 +863,7 @@ static void test_qemu_strtoll_invalid(void)
err = qemu_strtoll(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoll_trailing(void)
@ -1113,6 +1122,7 @@ static void test_qemu_strtoull_empty(void)
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoull_whitespace(void)
@ -1126,6 +1136,7 @@ static void test_qemu_strtoull_whitespace(void)
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoull_invalid(void)
@ -1139,6 +1150,7 @@ static void test_qemu_strtoull_invalid(void)
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, -EINVAL);
g_assert(endptr == str);
}
static void test_qemu_strtoull_trailing(void)