Fix possibly undefined values
[libisds.git] / test / isds_init.c
blob02e90080c33a9a9a68136e33ba6cdc7636dc9357
1 #include "test.h"
2 #include "isds.h"
4 static int test_init(const isds_error error) {
5 isds_error err;
7 err = isds_init();
8 if (err != error)
9 FAIL_TEST("Wrong return value");
11 PASS_TEST;
14 static int test_cleanup(const isds_error error) {
15 isds_error err;
17 err = isds_cleanup();
18 if (err != error)
19 FAIL_TEST("Wrong return value");
21 PASS_TEST;
24 static int test_reinit(void) {
25 if (isds_init()) {
26 isds_cleanup();
27 FAIL_TEST("isds_init() failed");
29 if (isds_cleanup())
30 FAIL_TEST("isds_cleanup() failed");
31 PASS_TEST;
34 int main(int argc, char **argv) {
36 INIT_TEST("isds_init");
38 TEST("first initialization", test_init, IE_SUCCESS);
39 TEST("first cleanup", test_cleanup, IE_SUCCESS);
41 TEST("reinitialization", test_reinit);
43 SUM_TEST();