diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-10-31 22:09:46 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-10-31 22:09:46 +0000 |
commit | d01f128b4580f312cd7ca7bf2329d80cdaced1b4 (patch) | |
tree | 3b449a8fb5491c8b274872fede6792ae92eafb05 /test | |
parent | e8efeb785c158581be729aa1dee122f50789ac86 (diff) |
Repair the refcount database while checking accounts for errors.
Normally this will be done by housekeeping anyway, so it's not that useful,
but it's good to check for it in tests, especially when testing
BackupStoreCheck's ability to repair bad things that happened to the store
when they involve references.
Diffstat (limited to 'test')
-rw-r--r-- | test/backupstorefix/testbackupstorefix.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/backupstorefix/testbackupstorefix.cpp b/test/backupstorefix/testbackupstorefix.cpp index 31cffc78..048251c2 100644 --- a/test/backupstorefix/testbackupstorefix.cpp +++ b/test/backupstorefix/testbackupstorefix.cpp @@ -845,7 +845,7 @@ int test(int argc, const char *argv[]) // spotting errors! But asserting an exact number will help us catch // changes in checker behaviour, so it's not a bad thing to test. - // The 11 errors are: + // The 12 errors are: // ERROR: Directory ID 0xb references object 0x3e which does not exist. // ERROR: Removing directory entry 0x3e from directory 0xb // ERROR: Directory ID 0xc had invalid entries, fixed @@ -857,8 +857,20 @@ int test(int argc, const char *argv[]) // ERROR: BlocksInCurrentFiles changed from 226 to 220 // ERROR: BlocksInDirectories changed from 56 to 54 // ERROR: NumFiles changed from 113 to 110 + // WARNING: Reference count of object 0x3e changed from 1 to 0 - RUN_CHECK_INTERNAL(11); + RUN_CHECK_INTERNAL(12); + + { + std::auto_ptr<BackupProtocolAccountUsage2> usage = + BackupProtocolLocal2(0x01234567, "test", + "backup/01234567/", 0, + false).QueryGetAccountUsage2(); + TEST_EQUAL(usage->GetBlocksUsed(), 278); + TEST_EQUAL(usage->GetBlocksInCurrentFiles(), 220); + TEST_EQUAL(usage->GetBlocksInDirectories(), 54); + TEST_EQUAL(usage->GetNumCurrentFiles(), 110); + } // Check everything is as it should be TEST_THAT(::system(PERL_EXECUTABLE |