1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include "../test.h"
#include "isds.h"
static int test_init(const isds_error error) {
isds_error err;
err = isds_init();
if (err != error)
FAIL_TEST("Wrong return value");
PASS_TEST;
}
static int test_cleanup(const isds_error error) {
isds_error err;
err = isds_cleanup();
if (err != error)
FAIL_TEST("Wrong return value");
PASS_TEST;
}
static int test_reinit(void) {
if (isds_init()) {
isds_cleanup();
FAIL_TEST("isds_init() failed");
}
if (isds_cleanup())
FAIL_TEST("isds_cleanup() failed");
PASS_TEST;
}
int main(int argc, char **argv) {
INIT_TEST("isds_init");
TEST("first initialization", test_init, IE_SUCCESS);
TEST("first cleanup", test_cleanup, IE_SUCCESS);
TEST("reinitialization", test_reinit);
SUM_TEST();
}
|