Skip to content

Commit 95cbb60

Browse files
committed
Fix compiling tests.
1 parent 7ea37de commit 95cbb60

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

test/test.vcproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@
262262
RelativePath="..\lib\filelister.cpp"
263263
>
264264
</File>
265+
<File
266+
RelativePath="..\lib\filelister_win32.cpp"
267+
>
268+
</File>
265269
<File
266270
RelativePath="..\lib\mathlib.cpp"
267271
>
@@ -452,6 +456,10 @@
452456
RelativePath="..\lib\filelister.h"
453457
>
454458
</File>
459+
<File
460+
RelativePath="..\lib\filelister_win32.h"
461+
>
462+
</File>
455463
<File
456464
RelativePath="..\lib\mathlib.h"
457465
>

test/testfilelister.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
#include <string>
2020
#include "testsuite.h"
21-
#include "filelister.h"
21+
22+
#if defined(_WIN32)
23+
#include "../lib/fileLister_win32.h"
24+
#else // POSIX-style system
25+
#include "../lib/filelister_unix.h"
26+
#endif
2227

2328
class TestFileLister : public TestFixture
2429
{
@@ -35,21 +40,19 @@ class TestFileLister : public TestFixture
3540

3641
void simplify_path()
3742
{
38-
ASSERT_EQUALS("index.h", FileLister::simplifyPath("index.h"));
39-
ASSERT_EQUALS("/index.h", FileLister::simplifyPath("/index.h"));
40-
ASSERT_EQUALS("/path/", FileLister::simplifyPath("/path/"));
41-
ASSERT_EQUALS("/", FileLister::simplifyPath("/"));
42-
ASSERT_EQUALS("./index.h", FileLister::simplifyPath("./index.h"));
43-
ASSERT_EQUALS("../index.h", FileLister::simplifyPath("../index.h"));
44-
ASSERT_EQUALS("/index.h", FileLister::simplifyPath("/path/../index.h"));
45-
ASSERT_EQUALS("/index.h", FileLister::simplifyPath("/path/../other/../index.h"));
46-
ASSERT_EQUALS("/index.h", FileLister::simplifyPath("/path/../other///././../index.h"));
47-
ASSERT_EQUALS("../path/index.h", FileLister::simplifyPath("../path/other/../index.h"));
48-
ASSERT_EQUALS("a/index.h", FileLister::simplifyPath("a/../a/index.h"));
49-
ASSERT_EQUALS("a/..", FileLister::simplifyPath("a/.."));
43+
ASSERT_EQUALS("index.h", getFileLister()->simplifyPath("index.h"));
44+
ASSERT_EQUALS("/index.h", getFileLister()->simplifyPath("/index.h"));
45+
ASSERT_EQUALS("/path/", getFileLister()->simplifyPath("/path/"));
46+
ASSERT_EQUALS("/", getFileLister()->simplifyPath("/"));
47+
ASSERT_EQUALS("./index.h", getFileLister()->simplifyPath("./index.h"));
48+
ASSERT_EQUALS("../index.h", getFileLister()->simplifyPath("../index.h"));
49+
ASSERT_EQUALS("/index.h", getFileLister()->simplifyPath("/path/../index.h"));
50+
ASSERT_EQUALS("/index.h", getFileLister()->simplifyPath("/path/../other/../index.h"));
51+
ASSERT_EQUALS("/index.h", getFileLister()->simplifyPath("/path/../other///././../index.h"));
52+
ASSERT_EQUALS("../path/index.h", getFileLister()->simplifyPath("../path/other/../index.h"));
53+
ASSERT_EQUALS("a/index.h", getFileLister()->simplifyPath("a/../a/index.h"));
54+
ASSERT_EQUALS("a/..", getFileLister()->simplifyPath("a/.."));
5055
}
51-
52-
5356
};
5457

5558
REGISTER_TEST(TestFileLister)

0 commit comments

Comments
 (0)