summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-04-22 14:37:10 +0000
committerChris Wilson <chris+github@qwirx.com>2007-04-22 14:37:10 +0000
commit4ce68eed0d932c45ec959a828a05aabbcbc6d33d (patch)
treeaf5546623b60a7867b0bf2cf93a9c58862096943 /test/bbackupd
parent8a8e956d8f2baa99d8924f05b3124788c5bb1ebd (diff)
Replace sleep() with safe_sleep() everywhere (refs #3)
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 320a0232..ac4efee9 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -426,7 +426,7 @@ int test_run_bbstored()
if(bbstored_pid > 0)
{
- ::sleep(1);
+ ::safe_sleep(1);
TEST_THAT(ServerIsAlive(bbstored_pid));
return 0; // success
}
@@ -437,7 +437,7 @@ int test_run_bbstored()
int test_kill_bbstored()
{
TEST_THAT(KillServer(bbstored_pid));
- ::sleep(1);
+ ::safe_sleep(1);
TEST_THAT(!ServerIsAlive(bbstored_pid));
#ifndef WIN32
@@ -640,7 +640,7 @@ int start_internal_daemon()
{
printf(".");
fflush(stdout);
- sleep(1);
+ safe_sleep(1);
pid = ReadPidFile("testfiles/bbackupd.pid");
if (pid > 0)
@@ -1047,7 +1047,7 @@ int test_bbackupd()
TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0);
- ::sleep(1);
+ ::safe_sleep(1);
if(bbackupd_pid > 0)
{
@@ -1588,7 +1588,7 @@ int test_bbackupd()
TEST_THAT(fd2 > 0);
TEST_THAT(write(fd1, "hello", 5) == 5);
TEST_THAT(close(fd1) == 0);
- sleep(1);
+ safe_sleep(1);
TEST_THAT(write(fd2, "world", 5) == 5);
TEST_THAT(close(fd2) == 0);
TEST_THAT(TestFileExists("testfiles/TestDir1/untracked-1"));
@@ -1631,7 +1631,7 @@ int test_bbackupd()
TEST_THAT(write(fd1, "hello", 5) == 5);
TEST_THAT(write(fd1, buffer, sizeof(buffer)) == sizeof(buffer));
TEST_THAT(close(fd1) == 0);
- sleep(1);
+ safe_sleep(1);
TEST_THAT(write(fd2, "world", 5) == 5);
TEST_THAT(write(fd2, buffer, sizeof(buffer)) == sizeof(buffer));
TEST_THAT(close(fd2) == 0);
@@ -1700,7 +1700,7 @@ int test_bbackupd()
TEST_THAT(::system("../../bin/bbackupctl/bbackupctl -q -c testfiles/bbackupd.conf wait-for-sync") == 0);
TestRemoteProcessMemLeaks("bbackupctl.memleaks");
// Then wait a second, to make sure the scan is complete
- ::sleep(1);
+ ::safe_sleep(1);
// Then modify an existing file
{
chmod("testfiles/TestDir1/sub23/rand.h", 0777); // in the archive, it's read only
@@ -1795,7 +1795,7 @@ int test_bbackupd()
TEST_THAT(::system("../../bin/bbackupctl/bbackupctl -c testfiles/bbackupd.conf wait-for-sync") == 0);
TestRemoteProcessMemLeaks("bbackupctl.memleaks");
// Then wait a second, to make sure the scan is complete
- ::sleep(1);
+ ::safe_sleep(1);
{
// Open a file, then save something to it every second
@@ -1805,7 +1805,7 @@ int test_bbackupd()
TEST_THAT(f != 0);
fprintf(f, "Loop iteration %d\n", l);
fflush(f);
- sleep(1);
+ safe_sleep(1);
printf(".");
fflush(stdout);
::fclose(f);
@@ -1826,7 +1826,7 @@ int test_bbackupd()
TEST_THAT(f != 0);
fprintf(f, "Loop 2 iteration %d\n", l);
fflush(f);
- sleep(1);
+ safe_sleep(1);
printf(".");
fflush(stdout);
::fclose(f);
@@ -1956,7 +1956,7 @@ int test_bbackupd()
TEST_THAT(::system("../../bin/bbackupctl/bbackupctl -q -c testfiles/bbackupd.conf wait-for-sync") == 0);
TestRemoteProcessMemLeaks("bbackupctl.memleaks");
// Then wait a second, to make sure the scan is complete
- ::sleep(1);
+ ::safe_sleep(1);
// Then modify an existing file
{
FILE *f = fopen("testfiles/TestDir1/sub23/in-the-future", "w");