diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-11-16 23:12:22 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-11-16 23:12:22 +0000 |
commit | 34aede1c187c06ad94076bb7947f879bae2889ce (patch) | |
tree | 48562ce736b78a42f157c8cdefa65d1630bfb432 /lib/backupstore | |
parent | 521c70553125b6da53c65a60e36fcc18aec36565 (diff) |
Fix test failures caused by reference count database changes.
Diffstat (limited to 'lib/backupstore')
-rw-r--r-- | lib/backupstore/StoreTestUtils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/backupstore/StoreTestUtils.cpp b/lib/backupstore/StoreTestUtils.cpp index 48b6370c..44bdb9c1 100644 --- a/lib/backupstore/StoreTestUtils.cpp +++ b/lib/backupstore/StoreTestUtils.cpp @@ -151,6 +151,17 @@ void set_refcount(int64_t ObjectID, uint32_t RefCount) ExpectedRefCounts.resize(ObjectID + 1, 0); } ExpectedRefCounts[ObjectID] = RefCount; + for (size_t i = ExpectedRefCounts.size() - 1; i >= 1; i--) + { + if (ExpectedRefCounts[i] == 0) + { + // BackupStoreCheck and housekeeping will both + // regenerate the refcount DB without any missing + // items at the end, so we need to prune ourselves + // of all items with no references to match. + ExpectedRefCounts.resize(i); + } + } } void init_context(TLSContext& rContext) |