diff options
Diffstat (limited to 'tests/core')
-rw-r--r-- | tests/core/mkdir.c | 7 | ||||
-rw-r--r-- | tests/core/structinit.c | 2 | ||||
-rw-r--r-- | tests/core/wildmatch.c | 12 | ||||
-rw-r--r-- | tests/core/zstream.c | 10 |
4 files changed, 16 insertions, 15 deletions
diff --git a/tests/core/mkdir.c b/tests/core/mkdir.c index ce11953f0..3f04c2ad3 100644 --- a/tests/core/mkdir.c +++ b/tests/core/mkdir.c @@ -150,10 +150,11 @@ static void cleanup_chmod_root(void *ref) git_futils_rmdir_r("r", NULL, GIT_RMDIR_EMPTY_HIERARCHY); } -#define check_mode(X,A) check_mode_at_line((X), (A), __FILE__, __LINE__) +#define check_mode(X,A) check_mode_at_line((X), (A), __FILE__, __func__, __LINE__) static void check_mode_at_line( - mode_t expected, mode_t actual, const char *file, int line) + mode_t expected, mode_t actual, + const char *file, const char *func, int line) { /* FAT filesystems don't support exec bit, nor group/world bits */ if (!cl_is_chmod_supported()) { @@ -162,7 +163,7 @@ static void check_mode_at_line( } clar__assert_equal( - file, line, "expected_mode != actual_mode", 1, + file, func, line, "expected_mode != actual_mode", 1, "%07o", (int)expected, (int)(actual & 0777)); } diff --git a/tests/core/structinit.c b/tests/core/structinit.c index f9da8237c..192096be3 100644 --- a/tests/core/structinit.c +++ b/tests/core/structinit.c @@ -48,7 +48,7 @@ static void options_cmp(void *one, void *two, size_t size, const char *name) p_snprintf(desc, 1024, "Difference in %s at byte %" PRIuZ ": macro=%u / func=%u", name, i, ((char *)one)[i], ((char *)two)[i]); - clar__fail(__FILE__, __LINE__, + clar__fail(__FILE__, __func__, __LINE__, "Difference between macro and function options initializer", desc, 0); return; diff --git a/tests/core/wildmatch.c b/tests/core/wildmatch.c index e7897c6e6..7c56ee7b8 100644 --- a/tests/core/wildmatch.c +++ b/tests/core/wildmatch.c @@ -3,21 +3,21 @@ #include "wildmatch.h" #define assert_matches(string, pattern, wildmatch, iwildmatch, pathmatch, ipathmatch) \ - assert_matches_(string, pattern, wildmatch, iwildmatch, pathmatch, ipathmatch, __FILE__, __LINE__) + assert_matches_(string, pattern, wildmatch, iwildmatch, pathmatch, ipathmatch, __FILE__, __func__, __LINE__) static void assert_matches_(const char *string, const char *pattern, char expected_wildmatch, char expected_iwildmatch, char expected_pathmatch, char expected_ipathmatch, - const char *file, size_t line) + const char *file, const char *func, size_t line) { if (wildmatch(pattern, string, WM_PATHNAME) == expected_wildmatch) - clar__fail(file, line, "Test failed (wildmatch).", string, 1); + clar__fail(file, func, line, "Test failed (wildmatch).", string, 1); if (wildmatch(pattern, string, WM_PATHNAME|WM_CASEFOLD) == expected_iwildmatch) - clar__fail(file, line, "Test failed (iwildmatch).", string, 1); + clar__fail(file, func, line, "Test failed (iwildmatch).", string, 1); if (wildmatch(pattern, string, 0) == expected_pathmatch) - clar__fail(file, line, "Test failed (pathmatch).", string, 1); + clar__fail(file, func, line, "Test failed (pathmatch).", string, 1); if (wildmatch(pattern, string, WM_CASEFOLD) == expected_ipathmatch) - clar__fail(file, line, "Test failed (ipathmatch).", string, 1); + clar__fail(file, func, line, "Test failed (ipathmatch).", string, 1); } /* diff --git a/tests/core/zstream.c b/tests/core/zstream.c index bcbb45fde..3cbcea168 100644 --- a/tests/core/zstream.c +++ b/tests/core/zstream.c @@ -9,7 +9,7 @@ static const char *data = "This is a test test test of This is a test"; static void assert_zlib_equal_( const void *expected, size_t e_len, const void *compressed, size_t c_len, - const char *msg, const char *file, int line) + const char *msg, const char *file, const char *func, int line) { z_stream stream; char *expanded = git__calloc(1, e_len + INFLATE_EXTRA); @@ -26,21 +26,21 @@ static void assert_zlib_equal_( inflateEnd(&stream); clar__assert_equal( - file, line, msg, 1, + file, func, line, msg, 1, "%d", (int)stream.total_out, (int)e_len); clar__assert_equal( - file, line, "Buffer len was not exact match", 1, + file, func, line, "Buffer len was not exact match", 1, "%d", (int)stream.avail_out, (int)INFLATE_EXTRA); clar__assert( memcmp(expanded, expected, e_len) == 0, - file, line, "uncompressed data did not match", NULL, 1); + file, func, line, "uncompressed data did not match", NULL, 1); git__free(expanded); } #define assert_zlib_equal(E,EL,C,CL) \ - assert_zlib_equal_(E, EL, C, CL, #EL " != " #CL, __FILE__, (int)__LINE__) + assert_zlib_equal_(E, EL, C, CL, #EL " != " #CL, __FILE__, __func__, (int)__LINE__) void test_core_zstream__basic(void) { |