From 0b8901506e2a47585edbdada41130d3aabf721c5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 25 Dec 2015 21:39:38 +0000 Subject: Fix deletion of fixtures between tests in test/backupstore. --- lib/common/Test.cpp | 11 ++++++----- 1 file 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); } } -- cgit v1.2.3