aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/check-qdict.c9
-rw-r--r--tests/check-qlist.c23
-rw-r--r--tests/check-qnum.c18
-rw-r--r--tests/check-qstring.c9
4 files changed, 6 insertions, 53 deletions
diff --git a/tests/check-qdict.c b/tests/check-qdict.c
index f067c63275..5eca1b5449 100644
--- a/tests/check-qdict.c
+++ b/tests/check-qdict.c
@@ -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)
diff --git a/tests/check-qlist.c b/tests/check-qlist.c
index a9b65c6239..894e9915e5 100644
--- a/tests/check-qlist.c
+++ b/tests/check-qlist.c
@@ -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();
diff --git a/tests/check-qnum.c b/tests/check-qnum.c
index d94cea024b..da7e0b0a9a 100644
--- a/tests/check-qnum.c
+++ b/tests/check-qnum.c
@@ -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);
diff --git a/tests/check-qstring.c b/tests/check-qstring.c
index 239e9d9da3..112ec08967 100644
--- a/tests/check-qstring.c
+++ b/tests/check-qstring.c
@@ -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);