6 #include <gtest/gtest.h>
15 TEST(LazyCycleDetectionTests, TestUnifiesCycles)
22 for (
int i = 0; i < 6; i++)
33 std::vector<util::HashSet<PointerObjectIndex>> successors(set.
NumPointerObjects());
34 successors[0].insert(1);
35 successors[1].insert(2);
36 successors[2].insert(3);
37 successors[2].insert(4);
38 successors[0].insert(5);
39 successors[5].insert(4);
44 return successors[i].Items();
53 auto notRoot = a + b - newRoot;
55 successors[newRoot].UnionWith(successors[notRoot]);
79 successors[3].insert(1);
90 successors[4].insert(0);
TEST(LazyCycleDetectionTests, TestUnifiesCycles)
size_t NumCycleUnifications() const noexcept
size_t NumCyclesDetected() const noexcept
size_t NumCycleDetectionAttempts() const noexcept
std::optional< PointerObjectIndex > OnPropagatedNothing(PointerObjectIndex subset, PointerObjectIndex superset)
PointerObjectIndex UnifyPointerObjects(PointerObjectIndex object1, PointerObjectIndex object2)
PointerObjectIndex CreateDummyRegisterPointerObject()
PointerObjectIndex GetUnificationRoot(PointerObjectIndex index) const noexcept
bool IsUnificationRoot(PointerObjectIndex index) const noexcept
size_t NumPointerObjects() const noexcept
uint32_t PointerObjectIndex