diff --git a/db/db_test.cc b/db/db_test.cc index 03ca9a796b..daea3aaaf1 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -385,6 +385,13 @@ class DBTest { return static_cast(files.size()); } + int CountLiveFiles() { + std::vector files; + uint64_t manifest_file_size; + db_->GetLiveFiles(files, &manifest_file_size); + return files.size(); + } + uint64_t Size(const Slice& start, const Slice& limit) { Range r(start, limit); uint64_t size; @@ -1631,12 +1638,12 @@ TEST(DBTest, NonWritableFileSystem) TEST(DBTest, FilesDeletedAfterCompaction) { ASSERT_OK(Put("foo", "v2")); Compact("a", "z"); - const int num_files = CountFiles(); + const int num_files = CountLiveFiles(); for (int i = 0; i < 10; i++) { ASSERT_OK(Put("foo", "v2")); Compact("a", "z"); } - ASSERT_EQ(CountFiles(), num_files); + ASSERT_EQ(CountLiveFiles(), num_files); } TEST(DBTest, BloomFilter) {