diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-14 13:12:51 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-14 13:12:51 +0000 |
commit | df5a57673b782ab36ef8d24893d607f04514600e (patch) | |
tree | 7f9ce1717105693e7cd1530246efe831a1ef1a46 /document/src/tests/fieldsettest.cpp | |
parent | 7bf5c4d363334993135f9edf77d9bbed306d03e4 (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.cpp | 7 |
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 |