diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/backupdiff/testbackupdiff.cpp | 28 | ||||
-rw-r--r-- | test/backupstore/testbackupstore.cpp | 13 | ||||
-rw-r--r-- | test/backupstorepatch/testbackupstorepatch.cpp | 13 |
3 files changed, 42 insertions, 12 deletions
diff --git a/test/backupdiff/testbackupdiff.cpp b/test/backupdiff/testbackupdiff.cpp index 4408b69f..584dd70c 100644 --- a/test/backupdiff/testbackupdiff.cpp +++ b/test/backupdiff/testbackupdiff.cpp @@ -169,9 +169,17 @@ void test_diff(int from, int to, int new_blocks_expected, int old_blocks_expecte { BackupStoreFilenameClear f1name("filename"); FileStream out(to_diff, O_WRONLY | O_CREAT | O_EXCL); - std::auto_ptr<IOStream> encoded(BackupStoreFile::EncodeFileDiff(to_orig, 1 /* dir ID */, f1name, - 1000 + from /* object ID of the file diffing from */, blockindex, IOStream::TimeOutInfinite, - 0, &completelyDifferent)); + std::auto_ptr<IOStream> encoded( + BackupStoreFile::EncodeFileDiff( + to_orig, + 1 /* dir ID */, + f1name, + 1000 + from /* object ID of the file diffing from */, + blockindex, + IOStream::TimeOutInfinite, + NULL, // DiffTimer interface + 0, + &completelyDifferent)); encoded->CopyStreamTo(out); } TEST_THAT(completelyDifferent == expect_completely_different); @@ -443,9 +451,17 @@ int test(int argc, const char *argv[]) BackupStoreFilenameClear f1name("filename"); FileStream out("testfiles/f2.symlink.diff", O_WRONLY | O_CREAT | O_EXCL); - std::auto_ptr<IOStream> encoded(BackupStoreFile::EncodeFileDiff("testfiles/f2.symlink", 1 /* dir ID */, f1name, - 1001 /* object ID of the file diffing from */, blockindex, IOStream::TimeOutInfinite, - 0, &completelyDifferent)); + std::auto_ptr<IOStream> encoded( + BackupStoreFile::EncodeFileDiff( + "testfiles/f2.symlink", + 1 /* dir ID */, + f1name, + 1001 /* object ID of the file diffing from */, + blockindex, + IOStream::TimeOutInfinite, + NULL, // DiffTimer interface + 0, + &completelyDifferent)); encoded->CopyStreamTo(out); } TEST_THAT(completelyDifferent == true); diff --git a/test/backupstore/testbackupstore.cpp b/test/backupstore/testbackupstore.cpp index 1d297f16..f89d2ff7 100644 --- a/test/backupstore/testbackupstore.cpp +++ b/test/backupstore/testbackupstore.cpp @@ -1072,9 +1072,16 @@ int test_server(const char *hostname) // Do the patching bool isCompletelyDifferent = false; int64_t modtime; - std::auto_ptr<IOStream> patchstream(BackupStoreFile::EncodeFileDiff(TEST_FILE_FOR_PATCHING ".mod", BackupProtocolClientListDirectory::RootDirectory, - uploads[UPLOAD_PATCH_EN].name, uploads[UPLOAD_PATCH_EN].allocated_objid, *blockIndexStream, - IOStream::TimeOutInfinite, &modtime, &isCompletelyDifferent)); + std::auto_ptr<IOStream> patchstream( + BackupStoreFile::EncodeFileDiff( + TEST_FILE_FOR_PATCHING ".mod", + BackupProtocolClientListDirectory::RootDirectory, + uploads[UPLOAD_PATCH_EN].name, + uploads[UPLOAD_PATCH_EN].allocated_objid, + *blockIndexStream, + IOStream::TimeOutInfinite, + NULL, // pointer to DiffTimer impl + &modtime, &isCompletelyDifferent)); TEST_THAT(isCompletelyDifferent == false); // Sent this to a file, so we can check the size, rather than uploading it directly { diff --git a/test/backupstorepatch/testbackupstorepatch.cpp b/test/backupstorepatch/testbackupstorepatch.cpp index a4a1ece3..5d77c3fd 100644 --- a/test/backupstorepatch/testbackupstorepatch.cpp +++ b/test/backupstorepatch/testbackupstorepatch.cpp @@ -376,10 +376,17 @@ int test(int argc, const char *argv[]) char filename[64]; ::sprintf(filename, "testfiles/%d.test", f); bool isCompletelyDifferent = false; - std::auto_ptr<IOStream> patchStream(BackupStoreFile::EncodeFileDiff(filename, + std::auto_ptr<IOStream> patchStream( + BackupStoreFile::EncodeFileDiff( + filename, BackupProtocolClientListDirectory::RootDirectory, /* containing directory */ - storeFilename, diffFromID, *blockIndexStream, - protocol.GetTimeout(), 0 /* not interested in the modification time */, &isCompletelyDifferent)); + storeFilename, + diffFromID, + *blockIndexStream, + protocol.GetTimeout(), + NULL, // DiffTimer impl + 0 /* not interested in the modification time */, + &isCompletelyDifferent)); // Upload the patch to the store std::auto_ptr<BackupProtocolClientSuccess> stored(protocol.QueryStoreFile( |