diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-22 21:26:40 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-22 21:26:40 +0000 |
commit | 3dcd45ed710132bcaa2fefe5bc2c4753c232b0d0 (patch) | |
tree | 0c2f499b96eb007359aa01cf9176f5546cc6a2ec /test | |
parent | 509fac53b3ebc5030c6bbff27ecf1c37907fb7ee (diff) |
Check file counts before messing with the store in test/backupstorefix.
Otherwise when the counts differ later, we won't know whether we did the setup
properly in the first place or not.
Diffstat (limited to 'test')
-rw-r--r-- | test/backupstorefix/testbackupstorefix.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/backupstorefix/testbackupstorefix.cpp b/test/backupstorefix/testbackupstorefix.cpp index b00862e1..5e5a288e 100644 --- a/test/backupstorefix/testbackupstorefix.cpp +++ b/test/backupstorefix/testbackupstorefix.cpp @@ -549,6 +549,22 @@ int test(int argc, const char *argv[]) // Stop bbackupd TEST_THAT_OR(StopClient(), return 1); + // Check that we're starting off with the right numbers of files and blocks. + // Otherwise the test that check the counts after breaking things will fail + // because the numbers won't match. + TEST_EQUAL(0, check_account_for_errors()); + { + std::auto_ptr<BackupProtocolAccountUsage2> usage = + BackupProtocolLocal2(0x01234567, "test", + "backup/01234567/", 0, + false).QueryGetAccountUsage2(); + TEST_EQUAL(usage->GetNumCurrentFiles(), 114); + TEST_EQUAL(usage->GetNumDirectories(), 28); + TEST_EQUAL(usage->GetBlocksUsed(), 284); + TEST_EQUAL(usage->GetBlocksInCurrentFiles(), 228); + TEST_EQUAL(usage->GetBlocksInDirectories(), 56); + } + BOX_INFO(" === Add a reference to a file that doesn't exist, check " "that it's removed"); { |