aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/tests/fieldsettest.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-14 13:12:51 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-14 13:12:51 +0000
commitdf5a57673b782ab36ef8d24893d607f04514600e (patch)
tree7f9ce1717105693e7cd1530246efe831a1ef1a46 /document/src/tests/fieldsettest.cpp
parent7bf5c4d363334993135f9edf77d9bbed306d03e4 (diff)
Make sure the entries in the set are unique.
Make both a less and equal operator so std::unique can be used to. Add and interface so that whole sets can be tested effectively if they are subsets.
Diffstat (limited to 'document/src/tests/fieldsettest.cpp')
-rw-r--r--document/src/tests/fieldsettest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/document/src/tests/fieldsettest.cpp b/document/src/tests/fieldsettest.cpp
index 8a01c53c278..29581ff4549 100644
--- a/document/src/tests/fieldsettest.cpp
+++ b/document/src/tests/fieldsettest.cpp
@@ -275,9 +275,10 @@ TEST(FieldCollectionTest, testHash ) {
const DocumentTypeRepo& repo = testDocMan.getTypeRepo();
const DocumentType & type = *repo.getDocumentType("testdoctype1");
EXPECT_EQ(0ul, FieldCollection(type, Field::Set::Builder().build()).hash());
- EXPECT_EQ(0x548599858c77ef83ul, FieldCollection(type, Field::Set::Builder().insert(&type.getField("headerval")).build()).hash());
- EXPECT_EQ(0x4a7ff2406d36a9b0ul, FieldCollection(type, Field::Set::Builder().insert(&type.getField("headerval")).insert(&type.getField("hstringval")).build()).hash());
- EXPECT_EQ(0x1e0918531b19734ul, FieldCollection(type, Field::Set::Builder().insert(&type.getField("hstringval")).build()).hash());
+ EXPECT_EQ(0x548599858c77ef83ul, FieldCollection(type, Field::Set::Builder().add(&type.getField("headerval")).build()).hash());
+ EXPECT_EQ(0x4a7ff2406d36a9b0ul, FieldCollection(type, Field::Set::Builder().add(&type.getField("headerval")).add(
+ &type.getField("hstringval")).build()).hash());
+ EXPECT_EQ(0x1e0918531b19734ul, FieldCollection(type, Field::Set::Builder().add(&type.getField("hstringval")).build()).hash());
}
} // document