summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/enum_comparator
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-03-03 21:55:04 +0100
committerTor Egge <Tor.Egge@online.no>2022-03-03 21:55:04 +0100
commit0b266f7959130ff8561ee6caf3dd5084e1f56992 (patch)
treefbcab28f24a3c21b1350c1b29168febb3e295b07 /searchlib/src/tests/attribute/enum_comparator
parentd538dbc39a3f8da7160c6f0c034ff40824cd4bed (diff)
Use AtomicEntryRef as key for unique store btree dictionary.
Diffstat (limited to 'searchlib/src/tests/attribute/enum_comparator')
-rw-r--r--searchlib/src/tests/attribute/enum_comparator/enum_comparator_test.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/searchlib/src/tests/attribute/enum_comparator/enum_comparator_test.cpp b/searchlib/src/tests/attribute/enum_comparator/enum_comparator_test.cpp
index 8c3d7173ae3..1d76473754f 100644
--- a/searchlib/src/tests/attribute/enum_comparator/enum_comparator_test.cpp
+++ b/searchlib/src/tests/attribute/enum_comparator/enum_comparator_test.cpp
@@ -11,6 +11,8 @@ LOG_SETUP("enum_comparator_test");
using namespace vespalib::btree;
+using vespalib::datastore::AtomicEntryRef;
+
namespace search {
using NumericEnumStore = EnumStoreT<int32_t>;
@@ -19,7 +21,7 @@ using StringEnumStore = EnumStoreT<const char*>;
using EnumIndex = IEnumStore::Index;
-using TreeType = BTreeRoot<EnumIndex, BTreeNoLeafData,
+using TreeType = BTreeRoot<AtomicEntryRef, BTreeNoLeafData,
vespalib::btree::NoAggregated,
const vespalib::datastore::EntryComparatorWrapper>;
using NodeAllocator = TreeType::NodeAllocatorType;
@@ -133,14 +135,14 @@ TEST("requireThatComparatorWithTreeIsWorking")
NodeAllocator m;
for (int32_t v = 100; v > 0; --v) {
auto cmp = es.make_comparator(v);
- EXPECT_FALSE(t.find(EnumIndex(), m, cmp).valid());
+ EXPECT_FALSE(t.find(AtomicEntryRef(), m, cmp).valid());
EnumIndex idx = es.insert(v);
- t.insert(idx, BTreeNoLeafData(), m, cmp);
+ t.insert(AtomicEntryRef(idx), BTreeNoLeafData(), m, cmp);
}
EXPECT_EQUAL(100u, t.size(m));
int32_t exp = 1;
for (TreeType::Iterator itr = t.begin(m); itr.valid(); ++itr) {
- EXPECT_EQUAL(exp++, es.get_value(itr.getKey()));
+ EXPECT_EQUAL(exp++, es.get_value(itr.getKey().load_relaxed()));
}
EXPECT_EQUAL(101, exp);
t.clear(m);