diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-09-11 13:59:37 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-09-11 13:59:37 +0000 |
commit | dc2d44671989fffab7dbf678003f1a178e23cc48 (patch) | |
tree | 31b173c8e7d1f9d15f969d2915ec346dbd68ab20 /searchcore/src/tests/proton/reference | |
parent | 5d131e88460f33a8bd16f39d5d57c1c690fd79f2 (diff) |
remove unused mapGidToLid() method from gid to lid mapper. Reference
attribute uses foreach() method on gid to lid mapper to bootstrap internal
mapping and receives notifyReferenced*() method calls to keep it updated.
Diffstat (limited to 'searchcore/src/tests/proton/reference')
-rw-r--r-- | searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp index 5445ba9c585..cec51e18e3c 100644 --- a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp +++ b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp @@ -37,10 +37,6 @@ BucketId toBucketId(const GlobalId &gid) { return bucketId; } -void assertLid(const std::unique_ptr<search::IGidToLidMapper> &mapper, const vespalib::string &docId, uint32_t lid) { - EXPECT_EQUAL(lid, mapper->mapGidToLid(toGid(docId))); -} - using GidMap = std::map<GlobalId, uint32_t>; struct GidCollector : public search::IGidToLidMapperVisitor @@ -66,6 +62,13 @@ void assertGids(const GidMap &expGids, const GidMap &gids) EXPECT_EQUAL(expGids, gids); } +void assertLid(const std::unique_ptr<search::IGidToLidMapper> &mapper, const vespalib::string &docId, uint32_t lid) { + auto gids = collectGids(mapper); + auto itr = gids.find(toGid(docId)); + uint32_t foundLid = (itr != gids.end()) ? itr->second : 0u; + EXPECT_EQUAL(lid, foundLid); +} + } struct Fixture @@ -139,15 +142,6 @@ struct Fixture } }; -TEST_F("Test that we can use gid mapper to get lids", Fixture) -{ - auto factory = f.getGidToLidMapperFactory(); - auto mapper = factory->getMapper(); - TEST_DO(assertLid(mapper, doc1, 4)); - TEST_DO(assertLid(mapper, doc2, 7)); - TEST_DO(assertLid(mapper, doc3, 0)); -} - TEST_F("Test that mapper holds read guard", Fixture) { TEST_DO(f.assertGenerations(3, 3)); |