diff options
author | Eric Albright <eric_albright@sil.org> | 2008-05-16 03:45:30 +0000 |
---|---|---|
committer | Eric Albright <eric_albright@sil.org> | 2008-05-16 03:45:30 +0000 |
commit | 4e466d50fae1d50a132740090c23c7674ab7435a (patch) | |
tree | 7b5aade50ef8627bdda0a554fca3cc08857519ef | |
parent | 65aacfa24a234a40f9d44a4db4d0e0f646c56304 (diff) | |
download | enchant-4e466d50fae1d50a132740090c23c7674ab7435a.tar.gz |
correct assert in test for rename of directory and make a little more robust by retrying once
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@23922 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r-- | unittests/EnchantTestFixture.h | 12 |
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)");
}
}
|