From 977bbf05e5b1e98256170c3d2441962ec4a13599 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 14 Sep 2017 14:00:21 +0100 Subject: [PATCH] [unit-tests/btree_counter_t] Add a couple of flushes(). This fixes the two failing btree_counter tests. The blocknr in each node is filled in when written out. These days (thanks to Ming) the counter also checks the btree, *but* if there are any problems encoutered it just skips counting that node. --- unit-tests/btree_counter_t.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unit-tests/btree_counter_t.cc b/unit-tests/btree_counter_t.cc index 0b64585..c6b8c67 100644 --- a/unit-tests/btree_counter_t.cc +++ b/unit-tests/btree_counter_t.cc @@ -61,6 +61,7 @@ namespace { TEST_F(BTreeCounterTests, count_empty_tree) { tree_.reset(new btree<1, uint64_traits>(tm_, rc_)); + tm_.get_bm()->flush(); check_nr_metadata_blocks_is_ge(1); } @@ -73,6 +74,7 @@ TEST_F(BTreeCounterTests, count_populated_tree) tree_->insert(key, 0ull); } + tm_.get_bm()->flush(); check_nr_metadata_blocks_is_ge(40); }