aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/document_iterator
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-01-05 21:37:36 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-01-06 13:51:43 +0000
commit6a27f0340bdc34b2ce3bbd1db29ca431ba8ed89e (patch)
tree5c7b2536964bc93e202c834838db8091b62bfabd /searchcore/src/tests/proton/document_iterator
parent4979cb8498a2cd6bb3ba7c48745a1ba7f69e2f5c (diff)
Simplify DocEntry to get a clean interface with multiple implementations, instead of an mutant.
Also add tests for the different variations a DocEntry can have.
Diffstat (limited to 'searchcore/src/tests/proton/document_iterator')
-rw-r--r--searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
index fab46e61494..b93553c3aa3 100644
--- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
+++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
@@ -49,6 +49,7 @@ using storage::spi::IterateResult;
using storage::spi::Selection;
using storage::spi::Timestamp;
using storage::spi::test::makeSpiBucket;
+using storage::spi::test::equal;
using namespace proton;
@@ -390,7 +391,7 @@ void checkEntry(const IterateResult &res, size_t idx, const Timestamp &timestamp
{
ASSERT_LESS(idx, res.getEntries().size());
DocEntry expect(timestamp, flags);
- EXPECT_EQUAL(expect, *res.getEntries()[idx]);
+ EXPECT_TRUE(equal(expect, *res.getEntries()[idx]));
EXPECT_EQUAL(getSize(), res.getEntries()[idx]->getSize());
}
@@ -398,7 +399,7 @@ void checkEntry(const IterateResult &res, size_t idx, const DocumentId &id, cons
{
ASSERT_LESS(idx, res.getEntries().size());
DocEntry expect(timestamp, storage::spi::REMOVE_ENTRY, id);
- EXPECT_EQUAL(expect, *res.getEntries()[idx]);
+ EXPECT_TRUE(equal(expect, *res.getEntries()[idx]));
EXPECT_EQUAL(getSize(id), res.getEntries()[idx]->getSize());
EXPECT_GREATER(getSize(id), 0u);
}
@@ -407,7 +408,7 @@ void checkEntry(const IterateResult &res, size_t idx, const Document &doc, const
{
ASSERT_LESS(idx, res.getEntries().size());
DocEntry expect(timestamp, storage::spi::NONE, Document::UP(doc.clone()));
- EXPECT_EQUAL(expect, *res.getEntries()[idx]);
+ EXPECT_TRUE(equal(expect, *res.getEntries()[idx]));
EXPECT_EQUAL(getSize(doc), res.getEntries()[idx]->getSize());
EXPECT_GREATER(getSize(doc), 0u);
}