START_TEST(qdict_put_obj_test)

{

    QInt *qi;

    QDict *qdict;

    QDictEntry *ent;

    const int num = 42;



    qdict = qdict_new();



    // key "" will have tdb hash 12345

    qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num)));



    fail_unless(qdict_size(qdict) == 1);

    ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);

    qi = qobject_to_qint(ent->value);

    fail_unless(qint_get_int(qi) == num);



    // destroy doesn't exit yet

    QDECREF(qi);

    g_free(ent->key);

    g_free(ent);

    g_free(qdict);

}

START_TEST(qdict_put_obj_test)

{

    QInt *qi;

    QDict *qdict;

    QDictEntry *ent;

    const int num = 42;



    qdict = qdict_new();



    

    qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num)));



    fail_unless(qdict_size(qdict) == 1);

    ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);

    qi = qobject_to_qint(ent->value);

    fail_unless(qint_get_int(qi) == num);



    

    QDECREF(qi);

    g_free(ent->key);

    g_free(ent);

    g_free(qdict);

}

FUNC_0(VAR_0)

{

    QInt *qi;

    QDict *qdict;

    QDictEntry *ent;

    const int VAR_1 = 42;



    qdict = qdict_new();



    

    qdict_put_obj(qdict, "", QOBJECT(qint_from_int(VAR_1)));



    fail_unless(qdict_size(qdict) == 1);

    ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);

    qi = qobject_to_qint(ent->value);

    fail_unless(qint_get_int(qi) == VAR_1);



    

    QDECREF(qi);

    g_free(ent->key);

    g_free(ent);

    g_free(qdict);

}

FUNC_0(VAR_0)
{ QInt *qi; QDict *qdict; QDictEntry *ent; const int VAR_1 = 42; qdict = qdict_new(); qdict_put_obj(qdict, "", QOBJECT(qint_from_int(VAR_1))); fail_unless(qdict_size(qdict) == 1); ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]); qi = qobject_to_qint(ent->value); fail_unless(qint_get_int(qi) == VAR_1); QDECREF(qi); g_free(ent->key); g_free(ent); g_free(qdict); }