static void test_qemu_strtol_max(void)
{
- const char *str = g_strdup_printf("%ld", LONG_MAX);
+ char *str = g_strdup_printf("%ld", LONG_MAX);
char f = 'X';
const char *endptr = &f;
long res = 999;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LONG_MAX);
g_assert(endptr == str + strlen(str));
+ g_free(str);
}
static void test_qemu_strtol_overflow(void)
static void test_qemu_strtol_full_max(void)
{
- const char *str = g_strdup_printf("%ld", LONG_MAX);
+ char *str = g_strdup_printf("%ld", LONG_MAX);
long res;
int err;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LONG_MAX);
+ g_free(str);
}
static void test_qemu_strtoul_correct(void)
static void test_qemu_strtoul_max(void)
{
- const char *str = g_strdup_printf("%lu", ULONG_MAX);
+ char *str = g_strdup_printf("%lu", ULONG_MAX);
char f = 'X';
const char *endptr = &f;
unsigned long res = 999;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULONG_MAX);
g_assert(endptr == str + strlen(str));
+ g_free(str);
}
static void test_qemu_strtoul_overflow(void)
static void test_qemu_strtoul_full_max(void)
{
- const char *str = g_strdup_printf("%lu", ULONG_MAX);
+ char *str = g_strdup_printf("%lu", ULONG_MAX);
unsigned long res = 999;
int err;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULONG_MAX);
+ g_free(str);
}
static void test_qemu_strtoll_correct(void)
static void test_qemu_strtoll_max(void)
{
- const char *str = g_strdup_printf("%lld", LLONG_MAX);
+ char *str = g_strdup_printf("%lld", LLONG_MAX);
char f = 'X';
const char *endptr = &f;
int64_t res = 999;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LLONG_MAX);
g_assert(endptr == str + strlen(str));
+ g_free(str);
}
static void test_qemu_strtoll_overflow(void)
static void test_qemu_strtoll_full_max(void)
{
- const char *str = g_strdup_printf("%lld", LLONG_MAX);
+ char *str = g_strdup_printf("%lld", LLONG_MAX);
int64_t res;
int err;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LLONG_MAX);
+ g_free(str);
}
static void test_qemu_strtoull_correct(void)
static void test_qemu_strtoull_max(void)
{
- const char *str = g_strdup_printf("%llu", ULLONG_MAX);
+ char *str = g_strdup_printf("%llu", ULLONG_MAX);
char f = 'X';
const char *endptr = &f;
uint64_t res = 999;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULLONG_MAX);
g_assert(endptr == str + strlen(str));
+ g_free(str);
}
static void test_qemu_strtoull_overflow(void)
static void test_qemu_strtoull_full_max(void)
{
- const char *str = g_strdup_printf("%lld", ULLONG_MAX);
+ char *str = g_strdup_printf("%lld", ULLONG_MAX);
uint64_t res = 999;
int err;
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULLONG_MAX);
+ g_free(str);
}
static void test_qemu_strtosz_simple(void)