From 3dcd45ed710132bcaa2fefe5bc2c4753c232b0d0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 22 Dec 2015 21:26:40 +0000 Subject: 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. --- test/backupstorefix/testbackupstorefix.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 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"); { -- cgit v1.2.3