2 * Test swift. Imports functions from test_sw_* files and runs tests.
14 static void (*test_fun_array[])(void) = {
19 getsockname_test_suite,
20 getsockopt_test_suite,
28 static void usage(const char *argv0)
30 fprintf(stderr, "Usage: %s [test_no]\n\n", argv0);
35 * In case of no arguments call all functions defined in test_fun_array.
38 int main(int argc, char **argv)
42 /* No arguments: call all test functions. */
45 for (i = 1; i < sizeof(test_fun_array)/sizeof(test_fun_array[0]); i++)
53 test_idx = atoi(argv[1]);
55 if (test_idx < 1 || test_idx >= sizeof(test_fun_array)/sizeof(test_fun_array[0])) {
56 fprintf(stderr, "Error: test index %d is out of bounds\n", test_idx);
60 test_fun_array[test_idx]();