START_TEST(simple_number)

{

    int i;

    struct {

        const char *encoded;

        int64_t decoded;

    } test_cases[] = {

        { "0", 0 },

        { "1234", 1234 },

        { "1", 1 },

        { "-32", -32 },

        { "-0", 0 },

        { },

    };



    for (i = 0; test_cases[i].encoded; i++) {

        QObject *obj;

        QInt *qint;



        obj = qobject_from_json(test_cases[i].encoded);

        fail_unless(obj != NULL);

        fail_unless(qobject_type(obj) == QTYPE_QINT);



        qint = qobject_to_qint(obj);

        fail_unless(qint_get_int(qint) == test_cases[i].decoded);



        QDECREF(qint);

    }

}

START_TEST(simple_number)

{

    int i;

    struct {

        const char *encoded;

        int64_t decoded;

    } test_cases[] = {

        { "0", 0 },

        { "1234", 1234 },

        { "1", 1 },

        { "-32", -32 },

        { "-0", 0 },

        { },

    };



    for (i = 0; test_cases[i].encoded; i++) {

        QObject *obj;

        QInt *qint;



        obj = qobject_from_json(test_cases[i].encoded);

        fail_unless(obj != NULL);

        fail_unless(qobject_type(obj) == QTYPE_QINT);



        qint = qobject_to_qint(obj);

        fail_unless(qint_get_int(qint) == test_cases[i].decoded);



        QDECREF(qint);

    }

}

FUNC_0(VAR_0)

{

    int VAR_1;

    struct {

        const char *encoded;

        int64_t decoded;

    } VAR_2[] = {

        { "0", 0 },

        { "1234", 1234 },

        { "1", 1 },

        { "-32", -32 },

        { "-0", 0 },

        { },

    };



    for (VAR_1 = 0; VAR_2[VAR_1].encoded; VAR_1++) {

        QObject *obj;

        QInt *qint;



        obj = qobject_from_json(VAR_2[VAR_1].encoded);

        fail_unless(obj != NULL);

        fail_unless(qobject_type(obj) == QTYPE_QINT);



        qint = qobject_to_qint(obj);

        fail_unless(qint_get_int(qint) == VAR_2[VAR_1].decoded);



        QDECREF(qint);

    }

}

FUNC_0(VAR_0)
{ int VAR_1; struct { const char *encoded; int64_t decoded; } VAR_2[] = { { "0", 0 }, { "1234", 1234 }, { "1", 1 }, { "-32", -32 }, { "-0", 0 }, { }, }; for (VAR_1 = 0; VAR_2[VAR_1].encoded; VAR_1++) { QObject *obj; QInt *qint; obj = qobject_from_json(VAR_2[VAR_1].encoded); fail_unless(obj != NULL); fail_unless(qobject_type(obj) == QTYPE_QINT); qint = qobject_to_qint(obj); fail_unless(qint_get_int(qint) == VAR_2[VAR_1].decoded); QDECREF(qint); } }