summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unittests/EnchantTestFixture.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/unittests/EnchantTestFixture.h b/unittests/EnchantTestFixture.h
index e0d860d..7a0c6ab 100644
--- a/unittests/EnchantTestFixture.h
+++ b/unittests/EnchantTestFixture.h
@@ -174,10 +174,16 @@ struct EnchantTestFixture
static void MoveDir(const std::string& from, const std::string& to)
{
int result = g_rename(from.c_str(), to.c_str());
- assert(result);
- if(result)
+ if(result!= 0)
{
- perror("failed");
+ perror("failed (will retry)");
+ // try once more.
+ result = g_rename(from.c_str(), to.c_str());
+ }
+ assert(result == 0);
+ if(result!= 0)
+ {
+ perror("failed (giving up)");
}
}