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
2328class 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
5558REGISTER_TEST (TestFileLister)
0 commit comments