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