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
+10
View File
@@ -176,6 +176,16 @@ public:
[[nodiscard]]
IntrusiveTreeSet() noexcept = default;
#ifndef NDEBUG
/**
* For debugging only: check the integrity of the red-black
* tree.
*/
void Check() noexcept {
RedBlackTreeNode::BlackHeight(GetRoot());
}
#endif
[[nodiscard]]
constexpr bool empty() const noexcept {
return GetRoot() == nullptr;