summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-12-25 21:39:38 +0000
committerChris Wilson <chris+github@qwirx.com>2015-12-25 21:39:38 +0000
commit0b8901506e2a47585edbdada41130d3aabf721c5 (patch)
tree9d152ddf709698e7791e07e18e0cfb73d834f16d
parent745a1e9243f074aadb2577d0b7a5d8f33efb15b5 (diff)
Fix deletion of fixtures between tests in test/backupstore.
-rw-r--r--lib/common/Test.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/common/Test.cpp b/lib/common/Test.cpp
index f7eeb310..1035864f 100644
--- a/lib/common/Test.cpp
+++ b/lib/common/Test.cpp
@@ -106,18 +106,19 @@ bool setUp(const char* function_name)
StartsWith("syncallowscript.notifyran.", filename) ||
filename == "test2.downloaded")
{
- int filetype = ObjectExists(std::string("testfiles/") + filename);
+ std::string filepath = std::string("testfiles\\") + filename;
+ int filetype = ObjectExists(filepath);
if(filetype == ObjectExists_File)
{
- if(!::unlink(filename.c_str()))
+ if(::unlink(filepath.c_str()) != 0)
{
TEST_FAIL_WITH_MESSAGE(BOX_SYS_ERROR_MESSAGE("Failed to delete "
- "test fixture file: unlink(\"" << filename << "\")"));
+ "test fixture file: unlink(\"" << filepath << "\")"));
}
}
else if(filetype == ObjectExists_Dir)
{
- std::string cmd = "rd /s /q testfiles\\" + filename;
+ std::string cmd = "rd /s /q " + filepath;
int status = system(cmd.c_str());
if(status != 0)
{
@@ -128,7 +129,7 @@ bool setUp(const char* function_name)
}
else
{
- TEST_FAIL_WITH_MESSAGE("Don't know how to delete file " << filename <<
+ TEST_FAIL_WITH_MESSAGE("Don't know how to delete file " << filepath <<
" of type " << filetype);
}
}