diff options
Diffstat (limited to 'tests/check-qdict.c')
-rw-r--r-- | tests/check-qdict.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/check-qdict.c b/tests/check-qdict.c index be8d81f..f067c63 100644 --- a/tests/check-qdict.c +++ b/tests/check-qdict.c @@ -11,7 +11,6 @@ */ #include "qemu/osdep.h" -#include "qapi/qmp/qint.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" #include "qapi/error.h" @@ -39,7 +38,7 @@ static void qdict_new_test(void) static void qdict_put_obj_test(void) { - QInt *qi; + QNum *qn; QDict *qdict; QDictEntry *ent; const int num = 42; @@ -51,11 +50,11 @@ static void qdict_put_obj_test(void) g_assert(qdict_size(qdict) == 1); ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]); - qi = qobject_to_qint(ent->value); - g_assert(qint_get_int(qi) == num); + qn = qobject_to_qnum(ent->value); + g_assert_cmpint(qnum_get_int(qn), ==, num); // destroy doesn't exit yet - QDECREF(qi); + QDECREF(qn); g_free(ent->key); g_free(ent); g_free(qdict); @@ -74,7 +73,7 @@ static void qdict_destroy_simple_test(void) static void qdict_get_test(void) { - QInt *qi; + QNum *qn; QObject *obj; const int value = -42; const char *key = "test"; @@ -85,8 +84,8 @@ static void qdict_get_test(void) obj = qdict_get(tests_dict, key); g_assert(obj != NULL); - qi = qobject_to_qint(obj); - g_assert(qint_get_int(qi) == value); + qn = qobject_to_qnum(obj); + g_assert_cmpint(qnum_get_int(qn), ==, value); QDECREF(tests_dict); } @@ -329,7 +328,7 @@ static void qdict_array_split_test(void) { QDict *test_dict = qdict_new(); QDict *dict1, *dict2; - QInt *int1; + QNum *int1; QList *test_list; /* @@ -380,7 +379,7 @@ static void qdict_array_split_test(void) dict1 = qobject_to_qdict(qlist_pop(test_list)); dict2 = qobject_to_qdict(qlist_pop(test_list)); - int1 = qobject_to_qint(qlist_pop(test_list)); + int1 = qobject_to_qnum(qlist_pop(test_list)); g_assert(dict1); g_assert(dict2); @@ -402,7 +401,7 @@ static void qdict_array_split_test(void) QDECREF(dict2); - g_assert(qint_get_int(int1) == 66); + g_assert_cmpint(qnum_get_int(int1), ==, 66); QDECREF(int1); @@ -447,14 +446,14 @@ static void qdict_array_split_test(void) qdict_array_split(test_dict, &test_list); - int1 = qobject_to_qint(qlist_pop(test_list)); + int1 = qobject_to_qnum(qlist_pop(test_list)); g_assert(int1); g_assert(qlist_empty(test_list)); QDECREF(test_list); - g_assert(qint_get_int(int1) == 42); + g_assert_cmpint(qnum_get_int(int1), ==, 42); QDECREF(int1); |