diff --git a/utilities/write_batch_with_index/write_batch_with_index_test.cc b/utilities/write_batch_with_index/write_batch_with_index_test.cc index ad8c110c1..1152c7b88 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_test.cc +++ b/utilities/write_batch_with_index/write_batch_with_index_test.cc @@ -235,27 +235,9 @@ TEST(WriteBatchWithIndexTest, TestValueAsSecondaryIndex) { } } -class ReverseComparator : public Comparator { - public: - ReverseComparator() {} - - virtual const char* Name() const override { - return "rocksdb.ReverseComparator"; - } - - virtual int Compare(const Slice& a, const Slice& b) const override { - return 0 - BytewiseComparator()->Compare(a, b); - } - - virtual void FindShortestSeparator(std::string* start, - const Slice& limit) const {} - virtual void FindShortSuccessor(std::string* key) const {} -}; - TEST(WriteBatchWithIndexTest, TestComparatorForCF) { - ReverseComparator reverse_cmp; ColumnFamilyHandleImplDummy cf1(6, nullptr); - ColumnFamilyHandleImplDummy reverse_cf(66, &reverse_cmp); + ColumnFamilyHandleImplDummy reverse_cf(66, ReverseBytewiseComparator()); ColumnFamilyHandleImplDummy cf2(88, BytewiseComparator()); WriteBatchWithIndex batch(BytewiseComparator(), 20);