tests: Adapt utf8locale to musl
[libisds.git] / test / offline / isds_hash_free.c
blob6fbba9a8a4b9ccc34c765dfb76655d597f8299d0
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(void) {
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();