[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] [Win32] test_util.c + test_checkdir.c



The src/test/test_util.c have this statement:

 #ifdef _WIN32
 #define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
 #define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
 #define UTIL_LEGACY_NO_WIN(n) UTIL_NO_WIN(n)

But I fail to see where 'UTIL_NO_WIN(n)' is defined. Should not the
above read:

--- a/test/test_util.c 2016-01-05 13:19:07
+++ b/test/test_util.c 2016-01-05 14:36:52
@@ -4676,7 +4676,7 @@
 #ifdef _WIN32
 #define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
 #define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
-#define UTIL_LEGACY_NO_WIN(n) UTIL_NO_WIN(n)
+#define UTIL_LEGACY_NO_WIN(n)   { #n, NULL, TT_SKIP, NULL, NULL }
 #else
 #define UTIL_TEST_NO_WIN(n, f) UTIL_TEST(n, (f))

With this, my test.exe runs fine. Although 36 SKIPPED tests.

Another thing regarding MSVC. In test/test_checkdir.c,
<dirent.h> is included for _WIN32. MSVC does not have this header.
Hence I think this patch is needed:

--- a/test/test_checkdir.c 2015-08-31 13:24:33
+++ b/test/test_checkdir.c 2015-08-31 14:50:53
@@ -4,9 +4,7 @@
 #include "orconfig.h"
 #include "or.h"

-#ifdef _WIN32
-#include <direct.h>
-#else
+#ifndef _MSC_VER
 #include <dirent.h>
 #endif

Since <direct.h> is already included in "or.h", it's not needed here
too.

-- 
--gv
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev