From: Sebastian Harl Date: Wed, 27 May 2015 20:48:21 +0000 (+0200) Subject: Drop sdb_store_get_host() from tests. X-Git-Tag: sysdb-0.8.0~62 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=da34466aea7bfa2d29df00b74ef8b3e8bd2da7de;p=sysdb.git Drop sdb_store_get_host() from tests. --- diff --git a/t/unit/core/store_test.c b/t/unit/core/store_test.c index ed6f5d9..6d528de 100644 --- a/t/unit/core/store_test.c +++ b/t/unit/core/store_test.c @@ -104,7 +104,7 @@ START_TEST(test_store_host) struct { const char *name; - _Bool has; + bool have; } golden_hosts[] = { { "a", 1 == 1 }, { "b", 1 == 1 }, @@ -126,12 +126,14 @@ START_TEST(test_store_host) } for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_hosts); ++i) { - _Bool has; - - has = sdb_store_has_host(golden_hosts[i].name); - fail_unless(has == golden_hosts[i].has, - "sdb_store_has_host(%s) = %d; expected: %d", - golden_hosts[i].name, has, golden_hosts[i].has); + sdb_store_obj_t *have; + + have = sdb_store_get_host(golden_hosts[i].name); + fail_unless((have != NULL) == golden_hosts[i].have, + "sdb_store_get_host(%s) = %p; expected: %s", + golden_hosts[i].name, have, + golden_hosts[i].have ? "" : "NULL"); + sdb_object_deref(SDB_OBJ(have)); } } END_TEST @@ -153,10 +155,6 @@ START_TEST(test_store_get_host) sdb_store_obj_t *sobj1, *sobj2; int ref_cnt; - fail_unless(sdb_store_has_host(golden_hosts[i]), - "sdb_store_has_host(%s) = FALSE; expected: TRUE", - golden_hosts[i]); - sobj1 = sdb_store_get_host(golden_hosts[i]); fail_unless(sobj1 != NULL, "sdb_store_get_host(%s) = NULL; expected: ", @@ -186,10 +184,6 @@ START_TEST(test_store_get_host) for (i = 0; i < SDB_STATIC_ARRAY_LEN(unknown_hosts); ++i) { sdb_store_obj_t *sobj; - fail_unless(!sdb_store_has_host(unknown_hosts[i]), - "sdb_store_has_host(%s) = TRUE; expected: FALSE", - unknown_hosts[i]); - sobj = sdb_store_get_host(unknown_hosts[i]); fail_unless(!sobj, "sdb_store_get_host(%s) = ; expected: NULL", unknown_hosts[i], sobj ? SDB_OBJ(sobj)->name : "NULL");