util/IntrusiveTreeSet: add debug method Check()

Only for the unit test.
This commit is contained in:
Max Kellermann
2024-04-10 09:39:36 +02:00
committed by Max Kellermann
parent 669cbcd25a
commit e0a53d4747
3 changed files with 44 additions and 0 deletions

View File

@@ -182,6 +182,10 @@ TEST(IntrusiveTreeSet, RandomOrder)
set.pop_front();
EXPECT_FALSE(items[remove].is_linked());
#ifndef NDEBUG
set.Check();
#endif
expected = remove + 1;
for (const auto &i : set) {
EXPECT_EQ(i.value, expected++);