Commit bbf9f5a78e42da9a7382c685dfa821589a7c6485

Patrick Steinhardt 2018-11-21T11:20:14

tests: path: only compile test_canonicalize on Win32 platforms The function `test_canonicalize` is only used on Win32 platforms. It will thus result in an unused function warning if these warnings are enabled and one is on a platform different than Win32. Fix the issue by only compiling in the function on Win32 platforms.

diff --git a/tests/path/win32.c b/tests/path/win32.c
index a5413c7..f45bf58 100644
--- a/tests/path/win32.c
+++ b/tests/path/win32.c
@@ -129,9 +129,9 @@ void test_path_win32__absolute_from_relative(void)
 #endif
 }
 
+#ifdef GIT_WIN32
 static void test_canonicalize(const wchar_t *in, const wchar_t *expected)
 {
-#ifdef GIT_WIN32
 	git_win32_path canonical;
 
 	cl_assert(wcslen(in) < MAX_PATH);
@@ -139,11 +139,8 @@ static void test_canonicalize(const wchar_t *in, const wchar_t *expected)
 
 	cl_must_pass(git_win32_path_canonicalize(canonical));
 	cl_assert_equal_wcs(expected, canonical);
-#else
-	GIT_UNUSED(in);
-	GIT_UNUSED(expected);
-#endif
 }
+#endif
 
 static void test_remove_namespace(const wchar_t *in, const wchar_t *expected)
 {