summaryrefslogtreecommitdiff
path: root/src/utils/files_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-29 20:26:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-29 20:26:16 +0300
commit9ff7894ef1eeff001f3ddc1a1caec18176428fa1 (patch)
treed6c8dc8dc37d752ac046552ff5e8226fa73a9ed6 /src/utils/files_unittest.cc
parent7e0e97ee7ec31512731cbcef625a040266655062 (diff)
downloadplus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.gz
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.bz2
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.xz
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.zip
Add some cleanup calls in unit tests.
Diffstat (limited to 'src/utils/files_unittest.cc')
-rw-r--r--src/utils/files_unittest.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/files_unittest.cc b/src/utils/files_unittest.cc
index 5ccfe0e04..9acd1e059 100644
--- a/src/utils/files_unittest.cc
+++ b/src/utils/files_unittest.cc
@@ -63,6 +63,7 @@ TEST_CASE("Files renameFile")
delete [] buf;
delete [] buf2;
+ ResourceManager::deleteInstance();
}
TEST_CASE("Files existsLocal")
@@ -76,6 +77,7 @@ TEST_CASE("Files existsLocal")
REQUIRE(Files::existsLocal(Files::getPath("help/about.txt")) == true);
REQUIRE_FALSE(Files::existsLocal(Files::getPath("help/about1.txt")));
REQUIRE_FALSE(Files::existsLocal(Files::getPath("help1/about.txt")));
+ ResourceManager::deleteInstance();
}
TEST_CASE("Files loadTextFileString")
@@ -88,6 +90,7 @@ TEST_CASE("Files loadTextFileString")
resourceManager->addToSearchPath("../data", Append_false);
REQUIRE(Files::loadTextFileString("test/simplefile.txt") ==
"this is test \nfile.");
+ ResourceManager::deleteInstance();
}
TEST_CASE("Files loadTextFile")
@@ -104,6 +107,7 @@ TEST_CASE("Files loadTextFile")
REQUIRE(lines.size() == 2);
REQUIRE(lines[0] == "this is test ");
REQUIRE(lines[1] == "file.");
+ ResourceManager::deleteInstance();
}
TEST_CASE("Files saveTextFile")
@@ -121,6 +125,7 @@ TEST_CASE("Files saveTextFile")
std::string data = Files::loadTextFileString("test/tempfile.txt");
::remove((dir + "/tempfile.txt").c_str());
REQUIRE(data == "test line\ntext line2\n");
+ ResourceManager::deleteInstance();
}
TEST_CASE("Files getFilesInDir")
@@ -149,4 +154,5 @@ TEST_CASE("Files getFilesInDir")
REQUIRE(list[2] == "perserver/default/defaultcommands.xml");
REQUIRE(list[3] == "perserver/default/features.xml");
REQUIRE(list[4] == "perserver/default/weapons.xml");
+ ResourceManager::deleteInstance();
}