source: branches/work_304/FileSystemUtilTest.cpp @ 327

Revision 327, 891 bytes checked in by jls17, 6 years ago (diff)
Line 
1#include "ARInsideTest.h"
2#include "FileSystemUtil.h"
3#include "FileSystemUtilTest.h"
4
5TEST(FileSystemUtil, IsDots_WithDots_Test)
6{
7        ASSERT_EQ(true, FileSystemUtil::IsDots("."));
8        ASSERT_EQ(true, FileSystemUtil::IsDots(".."));
9}
10
11TEST(FileSystemUtil, IsDots_WithoutDots_Test)
12{
13        ASSERT_EQ(false, FileSystemUtil::IsDots("testfile"));
14}
15
16TEST(FileSystemUtil, GetExecutableDirectory)
17{
18        string directory = FileSystemUtil::GetExecutableDirectory(argv_0);
19        directory = FileSystemUtil::GetRealPathName(directory);
20
21        string expectedDir = DIRECTORY_OF_TEST_BINARY;
22#ifdef WIN32
23        expectedDir = CUtil::StrReplace("/","\\", expectedDir);
24        std::transform(directory.begin(), directory.end(), directory.begin(), ::tolower);
25        std::transform(expectedDir.begin(), expectedDir.end(), expectedDir.begin(), ::tolower);
26#endif
27
28        ASSERT_STREQ(expectedDir.c_str(), directory.c_str());
29}
Note: See TracBrowser for help on using the repository browser.