summaryrefslogtreecommitdiff
path: root/src/utils/files_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-20 15:51:27 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-20 15:51:27 +0300
commitcf772ab6f9fdfe1647b9b7b79aab685ebc831f31 (patch)
tree25cdb35a8733efe3a4cb90e36cbb89e8e0c24c10 /src/utils/files_unittest.cc
parent80ba4766d8ce9861f6d026e791abc741e3fed0f4 (diff)
downloadplus-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.gz
plus-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.bz2
plus-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.xz
plus-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.zip
Fix some leaks in unit tests.
Add support for suppression some leaks in asan.
Diffstat (limited to 'src/utils/files_unittest.cc')
-rw-r--r--src/utils/files_unittest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/files_unittest.cc b/src/utils/files_unittest.cc
index ae2e69a99..78be3d924 100644
--- a/src/utils/files_unittest.cc
+++ b/src/utils/files_unittest.cc
@@ -23,6 +23,7 @@
#include "catch.hpp"
#include "logger.h"
+#include "utils/delete2.h"
#include "utils/virtfs.h"
#include "utils/virtfstools.h"
@@ -64,6 +65,7 @@ TEST_CASE("Files renameFile")
delete [] buf;
delete [] buf2;
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}
@@ -78,6 +80,7 @@ TEST_CASE("Files existsLocal")
REQUIRE_FALSE(Files::existsLocal(VirtFs::getPath("help/about1.txt")));
REQUIRE_FALSE(Files::existsLocal(VirtFs::getPath("help1/about.txt")));
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}
@@ -91,6 +94,7 @@ TEST_CASE("Files loadTextFileString")
REQUIRE(VirtFs::loadTextFileString("test/simplefile.txt") ==
"this is test \nfile.");
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}
@@ -108,6 +112,7 @@ TEST_CASE("Files loadTextFile")
REQUIRE(lines[0] == "this is test ");
REQUIRE(lines[1] == "file.");
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}
@@ -126,6 +131,7 @@ TEST_CASE("Files saveTextFile")
::remove((dir + "/tempfile.txt").c_str());
REQUIRE(data == "test line\ntext line2\n");
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}
@@ -155,5 +161,6 @@ TEST_CASE("Files getFilesInDir")
REQUIRE(list[3] == "perserver/default/features.xml");
REQUIRE(list[4] == "perserver/default/weapons.xml");
ResourceManager::deleteInstance();
+ delete2(logger);
// VirtFs::deinit();
}