static void test_qemu_strtoul_octal(void)

{

    const char *str = "0123";

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;



    err = qemu_strtoul(str, &endptr, 8, &res);



    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));



    res = 999;

    endptr = &f;

    err = qemu_strtoul(str, &endptr, 0, &res);



    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));

}

static void test_qemu_strtoul_octal(void)

{

    const char *str = "0123";

    char f = 'X';

    const char *endptr = &f;

    unsigned long res = 999;

    int err;



    err = qemu_strtoul(str, &endptr, 8, &res);



    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));



    res = 999;

    endptr = &f;

    err = qemu_strtoul(str, &endptr, 0, &res);



    g_assert_cmpint(err, ==, 0);

    g_assert_cmpint(res, ==, 0123);

    g_assert(endptr == str + strlen(str));

}

static void FUNC_0(void)

{

    const char *VAR_0 = "0123";

    char VAR_1 = 'X';

    const char *VAR_2 = &VAR_1;

    unsigned long VAR_3 = 999;

    int VAR_4;



    VAR_4 = qemu_strtoul(VAR_0, &VAR_2, 8, &VAR_3);



    g_assert_cmpint(VAR_4, ==, 0);

    g_assert_cmpint(VAR_3, ==, 0123);

    g_assert(VAR_2 == VAR_0 + strlen(VAR_0));



    VAR_3 = 999;

    VAR_2 = &VAR_1;

    VAR_4 = qemu_strtoul(VAR_0, &VAR_2, 0, &VAR_3);



    g_assert_cmpint(VAR_4, ==, 0);

    g_assert_cmpint(VAR_3, ==, 0123);

    g_assert(VAR_2 == VAR_0 + strlen(VAR_0));

}

static void FUNC_0(void)
{ const char *VAR_0 = "0123"; char VAR_1 = 'X'; const char *VAR_2 = &VAR_1; unsigned long VAR_3 = 999; int VAR_4; VAR_4 = qemu_strtoul(VAR_0, &VAR_2, 8, &VAR_3); g_assert_cmpint(VAR_4, ==, 0); g_assert_cmpint(VAR_3, ==, 0123); g_assert(VAR_2 == VAR_0 + strlen(VAR_0)); VAR_3 = 999; VAR_2 = &VAR_1; VAR_4 = qemu_strtoul(VAR_0, &VAR_2, 0, &VAR_3); g_assert_cmpint(VAR_4, ==, 0); g_assert_cmpint(VAR_3, ==, 0123); g_assert(VAR_2 == VAR_0 + strlen(VAR_0)); }