summaryrefslogtreecommitdiff
path: root/test/bbackupd/testbbackupd.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-10-29 20:55:43 +0000
committerChris Wilson <chris+github@qwirx.com>2008-10-29 20:55:43 +0000
commitc1be6b8e40f2626b3cf2bf3609f3bf73db6b2579 (patch)
tree240222d30b8635c6f62c8867a69de5d1a846df3a /test/bbackupd/testbbackupd.cpp
parente2750aba48a6e6e7138e89e4faedb7373a0ad9fa (diff)
Use the same ostringstream formatting for protocol logging to file
that we use for standard logging, to fix 64bit platform warnings reported by Matt Brown.
Diffstat (limited to 'test/bbackupd/testbbackupd.cpp')
-rw-r--r--test/bbackupd/testbbackupd.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index ade50d4b..97b3dc6e 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -1002,21 +1002,26 @@ int test_bbackupd()
// before any matching blocks could be found.
intercept_setup_delay("testfiles/TestDir1/spacetest/f1",
0, 4000, SYS_read, 1);
- pid = start_internal_daemon();
- intercept_clear_setup();
+ {
+ Timers::Init();
+ BackupDaemon bbackupd;
+ bbackupd.Configure("testfiles/bbackupd.conf");
+ bbackupd.InitCrypto();
- fd = open("testfiles/TestDir1/spacetest/f1", O_WRONLY);
- TEST_THAT(fd > 0);
- // write again, to update the file's timestamp
- TEST_EQUAL(sizeof(buffer), write(fd, buffer, sizeof(buffer)),
- "Buffer write");
- TEST_THAT(close(fd) == 0);
+ fd = open("testfiles/TestDir1/spacetest/f1", O_WRONLY);
+ TEST_THAT(fd > 0);
+ // write again, to update the file's timestamp
+ TEST_EQUAL(1, write(fd, "z", 1), "Buffer write");
+ TEST_THAT(close(fd) == 0);
- wait_for_backup_operation();
- // can't test whether intercept was triggered, because
- // it's in a different process.
- // TEST_THAT(intercept_triggered());
- TEST_THAT(stop_internal_daemon(pid));
+ // wait long enough to put file into sync window
+ wait_for_operation(5);
+
+ bbackupd.RunSyncNow();
+ TEST_THAT(intercept_triggered());
+ intercept_clear_setup();
+ Timers::Cleanup();
+ }
// check that the diff was aborted, i.e. upload was not a diff
found1 = false;
@@ -1174,7 +1179,7 @@ int test_bbackupd()
{
std::string line;
TEST_THAT(reader.GetLine(line));
- if (line == "Send ListDirectory(0x3,0xffffffff,0xc,true)")
+ if (line == "Send ListDirectory(0x3,0xffff,0xc,true)")
{
found1 = true;
break;