diff --git a/tests/cpath/test_cpath.c b/tests/cpath/test_cpath.c index 61b4d00..0744dfb 100644 --- a/tests/cpath/test_cpath.c +++ b/tests/cpath/test_cpath.c @@ -16,7 +16,7 @@ TestFuncResult test_cpath_join_path(void) { bool result = strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -25,7 +25,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -36,7 +36,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -47,7 +47,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -58,7 +58,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -67,7 +67,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_JOIN_PATH_EXIT; } memset(out, 0, strlen(out)); @@ -76,6 +76,7 @@ TestFuncResult test_cpath_join_path(void) { result = result && strcmp(out, expected) == 0; +TEST_JOIN_PATH_EXIT: return wapp_tester_result(result); } @@ -86,21 +87,21 @@ TestFuncResult test_cpath_dirname(void) { wapp_cpath_dirname(buf, "/"); bool result = strcmp(buf, "/") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRNAME_EXIT; } memset(buf, 0, strlen(buf)); wapp_cpath_dirname(buf, "home"); result = strcmp(buf, ".") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRNAME_EXIT; } memset(buf, 0, strlen(buf)); wapp_cpath_dirname(buf, ""); result = strcmp(buf, ".") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRNAME_EXIT; } memset(buf, 0, strlen(buf)); @@ -108,7 +109,7 @@ TestFuncResult test_cpath_dirname(void) { wapp_cpath_dirname(buf, tmp); result = strcmp(buf, "/home") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRNAME_EXIT; } memset(buf, 0, strlen(buf)); @@ -117,6 +118,7 @@ TestFuncResult test_cpath_dirname(void) { wapp_cpath_dirname(buf, tmp); result = strcmp(buf, "/home") == 0; +TEST_DIRNAME_EXIT: return wapp_tester_result(result); } @@ -127,7 +129,7 @@ TestFuncResult test_cpath_dirup(void) { wapp_cpath_dirup(buf, 3, "/"); bool result = strcmp(buf, "/") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRUP_EXIT; } memset(buf, 0, strlen(buf)); @@ -135,7 +137,7 @@ TestFuncResult test_cpath_dirup(void) { wapp_cpath_dirup(buf, 3, tmp); result = strcmp(buf, "/") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRUP_EXIT; } memset(buf, 0, strlen(buf)); @@ -144,7 +146,7 @@ TestFuncResult test_cpath_dirup(void) { wapp_cpath_dirup(buf, 3, tmp); result = strcmp(buf, ".") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRUP_EXIT; } memset(buf, 0, strlen(buf)); @@ -152,7 +154,7 @@ TestFuncResult test_cpath_dirup(void) { wapp_cpath_dirup(buf, 2, tmp); result = strcmp(buf, "/home") == 0; if (!result) { - return wapp_tester_result(result); + goto TEST_DIRUP_EXIT; } memset(buf, 0, strlen(buf)); @@ -161,5 +163,6 @@ TestFuncResult test_cpath_dirup(void) { wapp_cpath_dirup(buf, 2, tmp); result = strcmp(buf, "home") == 0; +TEST_DIRUP_EXIT: return wapp_tester_result(result); }