From 50de448f2a95e185e9fe112f8d837d647d4e1486 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 17 May 2013 16:51:38 +0100 Subject: [PATCH] [btree_damage_visitor_t] node_info << operator --- unit-tests/btree_damage_visitor_t.cc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/unit-tests/btree_damage_visitor_t.cc b/unit-tests/btree_damage_visitor_t.cc index 97b829c..3aaf008 100644 --- a/unit-tests/btree_damage_visitor_t.cc +++ b/unit-tests/btree_damage_visitor_t.cc @@ -74,6 +74,28 @@ namespace { range keys; }; + ostream &operator <<(ostream &out, node_info const &ni) { + out << "node_info [leaf = " << ni.leaf + << ", depth " << ni.depth + << ", path ["; + + bool first = true; + for (auto k : ni.path) { + if (first) + first = false; + else + out << ", "; + + out << k; + } + + out << "], b " << ni.b + << ", keys " << ni.keys + << "]"; + + return out; + } + bool is_leaf(node_info const &n) { return n.leaf; } @@ -393,7 +415,8 @@ namespace { uint64_t key[2] = {sub_tree, i}; btree_path path; path.push_back(sub_tree); - EXPECT_CALL(value_visitor_, visit(Eq(path), Eq(key_to_value(key)))); + EXPECT_CALL(value_visitor_, visit(Eq(path), + Eq(key_to_value(key)))); } }