tests: remove /{qnum, qlist, dict}/destroy test
The tests aren't really useful, or already covered by other simple tests. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-9-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
60390d2dc8
commit
36aeb6094f
@ -32,8 +32,7 @@ static void qdict_new_test(void)
|
||||
g_assert(qdict->base.refcnt == 1);
|
||||
g_assert(qobject_type(QOBJECT(qdict)) == QTYPE_QDICT);
|
||||
|
||||
// destroy doesn't exit yet
|
||||
g_free(qdict);
|
||||
QDECREF(qdict);
|
||||
}
|
||||
|
||||
static void qdict_put_obj_test(void)
|
||||
@ -53,11 +52,7 @@ static void qdict_put_obj_test(void)
|
||||
qn = qobject_to_qnum(ent->value);
|
||||
g_assert_cmpint(qnum_get_int(qn), ==, num);
|
||||
|
||||
// destroy doesn't exit yet
|
||||
QDECREF(qn);
|
||||
g_free(ent->key);
|
||||
g_free(ent);
|
||||
g_free(qdict);
|
||||
QDECREF(qdict);
|
||||
}
|
||||
|
||||
static void qdict_destroy_simple_test(void)
|
||||
|
@ -30,8 +30,7 @@ static void qlist_new_test(void)
|
||||
g_assert(qlist->base.refcnt == 1);
|
||||
g_assert(qobject_type(QOBJECT(qlist)) == QTYPE_QLIST);
|
||||
|
||||
// destroy doesn't exist yet
|
||||
g_free(qlist);
|
||||
QDECREF(qlist);
|
||||
}
|
||||
|
||||
static void qlist_append_test(void)
|
||||
@ -49,10 +48,7 @@ static void qlist_append_test(void)
|
||||
g_assert(entry != NULL);
|
||||
g_assert(entry->value == QOBJECT(qi));
|
||||
|
||||
// destroy doesn't exist yet
|
||||
QDECREF(qi);
|
||||
g_free(entry);
|
||||
g_free(qlist);
|
||||
QDECREF(qlist);
|
||||
}
|
||||
|
||||
static void qobject_to_qlist_test(void)
|
||||
@ -63,20 +59,6 @@ static void qobject_to_qlist_test(void)
|
||||
|
||||
g_assert(qobject_to_qlist(QOBJECT(qlist)) == qlist);
|
||||
|
||||
// destroy doesn't exist yet
|
||||
g_free(qlist);
|
||||
}
|
||||
|
||||
static void qlist_destroy_test(void)
|
||||
{
|
||||
int i;
|
||||
QList *qlist;
|
||||
|
||||
qlist = qlist_new();
|
||||
|
||||
for (i = 0; i < 42; i++)
|
||||
qlist_append_int(qlist, i);
|
||||
|
||||
QDECREF(qlist);
|
||||
}
|
||||
|
||||
@ -125,7 +107,6 @@ int main(int argc, char **argv)
|
||||
g_test_add_func("/public/new", qlist_new_test);
|
||||
g_test_add_func("/public/append", qlist_append_test);
|
||||
g_test_add_func("/public/to_qlist", qobject_to_qlist_test);
|
||||
g_test_add_func("/public/destroy", qlist_destroy_test);
|
||||
g_test_add_func("/public/iter", qlist_iter_test);
|
||||
|
||||
return g_test_run();
|
||||
|
@ -36,8 +36,7 @@ static void qnum_from_int_test(void)
|
||||
g_assert_cmpint(qn->base.refcnt, ==, 1);
|
||||
g_assert_cmpint(qobject_type(QOBJECT(qn)), ==, QTYPE_QNUM);
|
||||
|
||||
// destroy doesn't exit yet
|
||||
g_free(qn);
|
||||
QDECREF(qn);
|
||||
}
|
||||
|
||||
static void qnum_from_double_test(void)
|
||||
@ -52,8 +51,7 @@ static void qnum_from_double_test(void)
|
||||
g_assert_cmpint(qn->base.refcnt, ==, 1);
|
||||
g_assert_cmpint(qobject_type(QOBJECT(qn)), ==, QTYPE_QNUM);
|
||||
|
||||
// destroy doesn't exit yet
|
||||
g_free(qn);
|
||||
QDECREF(qn);
|
||||
}
|
||||
|
||||
static void qnum_from_int64_test(void)
|
||||
@ -109,24 +107,12 @@ static void qnum_to_string_test(void)
|
||||
QDECREF(qn);
|
||||
}
|
||||
|
||||
static void qnum_destroy_test(void)
|
||||
{
|
||||
QNum *qn;
|
||||
|
||||
qn = qnum_from_int(0);
|
||||
QDECREF(qn);
|
||||
|
||||
qn = qnum_from_double(0.42);
|
||||
QDECREF(qn);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func("/qnum/from_int", qnum_from_int_test);
|
||||
g_test_add_func("/qnum/from_double", qnum_from_double_test);
|
||||
g_test_add_func("/qnum/destroy", qnum_destroy_test);
|
||||
g_test_add_func("/qnum/from_int64", qnum_from_int64_test);
|
||||
g_test_add_func("/qnum/get_int", qnum_get_int_test);
|
||||
g_test_add_func("/qnum/to_qnum", qobject_to_qnum_test);
|
||||
|
@ -31,14 +31,6 @@ static void qstring_from_str_test(void)
|
||||
g_assert(strcmp(str, qstring->string) == 0);
|
||||
g_assert(qobject_type(QOBJECT(qstring)) == QTYPE_QSTRING);
|
||||
|
||||
// destroy doesn't exit yet
|
||||
g_free(qstring->string);
|
||||
g_free(qstring);
|
||||
}
|
||||
|
||||
static void qstring_destroy_test(void)
|
||||
{
|
||||
QString *qstring = qstring_from_str("destroy test");
|
||||
QDECREF(qstring);
|
||||
}
|
||||
|
||||
@ -97,7 +89,6 @@ int main(int argc, char **argv)
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func("/public/from_str", qstring_from_str_test);
|
||||
g_test_add_func("/public/destroy", qstring_destroy_test);
|
||||
g_test_add_func("/public/get_str", qstring_get_str_test);
|
||||
g_test_add_func("/public/append_chr", qstring_append_chr_test);
|
||||
g_test_add_func("/public/from_substr", qstring_from_substr_test);
|
||||
|
Loading…
Reference in New Issue
Block a user