summaryrefslogtreecommitdiff
path: root/src/fs/files_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-07 22:02:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-07 22:02:59 +0300
commitbbd71d4a8c95092deb9cbf4aef86722a1e9628db (patch)
tree59566c4baa2e32287fe5867e5616ca560d3f3bf5 /src/fs/files_unittest.cc
parent6f7f469430ea05946a11dd41f62010961be6285e (diff)
downloadplus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.gz
plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.bz2
plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.xz
plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.zip
Fix unit tests on windows.
Diffstat (limited to 'src/fs/files_unittest.cc')
-rw-r--r--src/fs/files_unittest.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fs/files_unittest.cc b/src/fs/files_unittest.cc
index 19fd40ec1..d2bac3256 100644
--- a/src/fs/files_unittest.cc
+++ b/src/fs/files_unittest.cc
@@ -34,7 +34,6 @@
TEST_CASE("Files renameFile")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);
@@ -74,7 +73,6 @@ TEST_CASE("Files renameFile")
TEST_CASE("Files existsLocal")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);
@@ -91,7 +89,6 @@ TEST_CASE("Files existsLocal")
TEST_CASE("Files loadTextFileString")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);
@@ -107,7 +104,6 @@ TEST_CASE("Files loadTextFileString")
TEST_CASE("Files loadTextFile")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);
@@ -127,7 +123,6 @@ TEST_CASE("Files loadTextFile")
TEST_CASE("Files saveTextFile")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);
@@ -138,7 +133,13 @@ TEST_CASE("Files saveTextFile")
Files::saveTextFile(dir, "tempfile.txt", "test line\ntext line2");
std::string data = VirtFs::loadTextFileString("test/tempfile.txt");
::remove((dir + "/tempfile.txt").c_str());
+#ifdef WIN32
+ REQUIRE(data == "test line\r\ntext line2\r\n");
+#else // WIN32
+
REQUIRE(data == "test line\ntext line2\n");
+#endif // WIN32
+
ResourceManager::deleteInstance();
VirtFs::removeDirFromSearchPathSilent("data");
VirtFs::removeDirFromSearchPathSilent("../data");
@@ -148,7 +149,6 @@ TEST_CASE("Files saveTextFile")
TEST_CASE("Files getFilesInDir")
{
- dirSeparator = "/";
logger = new Logger();
ResourceManager::init();
VirtFs::addDirToSearchPathSilent("data", Append_false);