From 15edb4deb9258fb7a0ed3ba3ad81283ec770c628 Mon Sep 17 00:00:00 2001 From: Johannes Kalmbach Date: Thu, 7 Nov 2024 22:12:07 +0100 Subject: [PATCH] Fix merge conflicts. Signed-off-by: Johannes Kalmbach --- src/index/DeltaTriples.cpp | 3 +- test/DeltaTriplesTestHelpers.h | 2 +- test/IndexTest.cpp | 54 ++++++++++++++++++++++------------ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/index/DeltaTriples.cpp b/src/index/DeltaTriples.cpp index 7c4239a682..de8a474602 100644 --- a/src/index/DeltaTriples.cpp +++ b/src/index/DeltaTriples.cpp @@ -40,7 +40,8 @@ DeltaTriples::locateAndAddTriples(CancellationHandle cancellationHandle, cancellationHandle); cancellationHandle->throwIfCancelled(); intermediateHandles[static_cast(permutation)] = - locatedTriples()[static_cast(permutation)].add(locatedTriples); + this->locatedTriples()[static_cast(permutation)].add( + locatedTriples); cancellationHandle->throwIfCancelled(); } std::vector handles{idTriples.size()}; diff --git a/test/DeltaTriplesTestHelpers.h b/test/DeltaTriplesTestHelpers.h index 586a54196a..bf64175a17 100644 --- a/test/DeltaTriplesTestHelpers.h +++ b/test/DeltaTriplesTestHelpers.h @@ -25,7 +25,7 @@ inline auto InAllPermutations = absl::StrCat(".getLocatedTriplesPerBlock(", Permutation::toString(perm), ")"), [perm](const DeltaTriples& deltaTriples) { - return deltaTriples.getLocatedTriplesPerBlock(perm); + return deltaTriples.getLocatedTriplesForPermutation(perm); }, InnerMatcher); })); diff --git a/test/IndexTest.cpp b/test/IndexTest.cpp index 2107b6ecf8..6ce7f6f732 100644 --- a/test/IndexTest.cpp +++ b/test/IndexTest.cpp @@ -92,7 +92,7 @@ TEST(IndexTest, createFromTurtleTest) { return; } const auto& [index, qec] = getIndex(); - const auto& deltaTriples = qec.locatedTriplesSnapshot_(); + const auto& locatedTriplesSnapshot = qec.locatedTriplesSnapshot(); auto getId = makeGetId(getQec(kb)->getIndex()); Id a = getId(""); @@ -103,33 +103,49 @@ TEST(IndexTest, createFromTurtleTest) { Id c2 = getId(""); // TODO We could also test the multiplicities here. - ASSERT_TRUE(index.PSO().getMetadata(b, deltaTriples).has_value()); - ASSERT_TRUE(index.PSO().getMetadata(b2, deltaTriples).has_value()); - ASSERT_FALSE(index.PSO().getMetadata(a2, deltaTriples).has_value()); - ASSERT_FALSE(index.PSO().getMetadata(c, deltaTriples).has_value()); + ASSERT_TRUE( + index.PSO().getMetadata(b, locatedTriplesSnapshot).has_value()); + ASSERT_TRUE( + index.PSO().getMetadata(b2, locatedTriplesSnapshot).has_value()); + ASSERT_FALSE( + index.PSO().getMetadata(a2, locatedTriplesSnapshot).has_value()); + ASSERT_FALSE( + index.PSO().getMetadata(c, locatedTriplesSnapshot).has_value()); ASSERT_FALSE( index.PSO() .getMetadata(Id::makeFromVocabIndex(VocabIndex::make(735)), - deltaTriples) + locatedTriplesSnapshot) .has_value()); - ASSERT_FALSE( - index.PSO().getMetadata(b, deltaTriples).value().isFunctional()); - ASSERT_TRUE( - index.PSO().getMetadata(b2, deltaTriples).value().isFunctional()); + ASSERT_FALSE(index.PSO() + .getMetadata(b, locatedTriplesSnapshot) + .value() + .isFunctional()); + ASSERT_TRUE(index.PSO() + .getMetadata(b2, locatedTriplesSnapshot) + .value() + .isFunctional()); - ASSERT_TRUE(index.POS().getMetadata(b, deltaTriples).has_value()); - ASSERT_TRUE(index.POS().getMetadata(b2, deltaTriples).has_value()); - ASSERT_FALSE(index.POS().getMetadata(a2, deltaTriples).has_value()); - ASSERT_FALSE(index.POS().getMetadata(c, deltaTriples).has_value()); + ASSERT_TRUE( + index.POS().getMetadata(b, locatedTriplesSnapshot).has_value()); + ASSERT_TRUE( + index.POS().getMetadata(b2, locatedTriplesSnapshot).has_value()); + ASSERT_FALSE( + index.POS().getMetadata(a2, locatedTriplesSnapshot).has_value()); + ASSERT_FALSE( + index.POS().getMetadata(c, locatedTriplesSnapshot).has_value()); ASSERT_FALSE( index.POS() .getMetadata(Id::makeFromVocabIndex(VocabIndex::make(735)), - deltaTriples) + locatedTriplesSnapshot) .has_value()); - ASSERT_TRUE( - index.POS().getMetadata(b, deltaTriples).value().isFunctional()); - ASSERT_TRUE( - index.POS().getMetadata(b2, deltaTriples).value().isFunctional()); + ASSERT_TRUE(index.POS() + .getMetadata(b, locatedTriplesSnapshot) + .value() + .isFunctional()); + ASSERT_TRUE(index.POS() + .getMetadata(b2, locatedTriplesSnapshot) + .value() + .isFunctional()); // Relation b // Pair index