test: Add isds_event_free
[libisds.git] / test / isds_hash_free.c
blob0babcb895ca919eeb70a3bb0332289e090f8dd2c
1 #include "test.h"
2 #include "isds.h"
4 static int test_isds_hash_free(
5 struct isds_hash **hash) {
6 isds_hash_free(hash);
7 if (!hash) PASS_TEST;
9 if (*hash)
10 FAIL_TEST("isds_hash_free() did not null pointer");
12 PASS_TEST;
16 int main(int argc, char **argv) {
18 INIT_TEST("isds_hash_free()");
19 if (isds_init())
20 ABORT_UNIT("isds_init() failed");
22 struct isds_hash *hash = NULL;
23 TEST("NULL", test_isds_hash_free, NULL);
24 TEST("*NULL", test_isds_hash_free, &hash);
26 TEST_CALLOC(hash);
27 TEST("Empty structure", test_isds_hash_free, &hash);
29 TEST_CALLOC(hash);
30 TEST_FILL_STRING(hash->value);
31 TEST("Full structure", test_isds_hash_free, &hash);
33 isds_cleanup();
34 SUM_TEST();