diff --git a/persistent-data/data-structures/btree_damage_visitor.h b/persistent-data/data-structures/btree_damage_visitor.h index 08aaabe..dba39a0 100644 --- a/persistent-data/data-structures/btree_damage_visitor.h +++ b/persistent-data/data-structures/btree_damage_visitor.h @@ -18,11 +18,6 @@ namespace persistent_data { desc_(desc) { } - // FIXME: Write a matcher instead. Does _not_ compare the descriptions - bool operator ==(damage const &rhs) const { - return (lost_keys_ == rhs.lost_keys_); - } - range lost_keys_; std::string desc_; }; diff --git a/unit-tests/btree_damage_visitor_t.cc b/unit-tests/btree_damage_visitor_t.cc index 8ef6951..11b58fc 100644 --- a/unit-tests/btree_damage_visitor_t.cc +++ b/unit-tests/btree_damage_visitor_t.cc @@ -225,6 +225,10 @@ namespace { //---------------------------------- + MATCHER_P(DamagedKeys, keys, "") { + return arg.lost_keys_ == keys; + } + class value_visitor_mock { public: MOCK_METHOD1(visit, void(thing const &)); @@ -270,7 +274,7 @@ namespace { } void expect_damage(unsigned level, range keys) { - EXPECT_CALL(damage_visitor_, visit(Eq(damage(keys, "foo")))).Times(1); + EXPECT_CALL(damage_visitor_, visit(DamagedKeys(keys))).Times(1); } //--------------------------------