* subtree is not red-black.
*/
+#ifdef EXTREME_DICT_DEBUG
static unsigned int verify_redblack(dnode_t *nil, dnode_t *root)
{
unsigned height_left, height_right;
}
return 1;
}
+#endif
/*
* Compute the actual count of nodes by traversing the tree and
* detect a mismatch.
*/
+#ifdef EXTREME_DICT_DEBUG
static dictcount_t verify_node_count(dnode_t *nil, dnode_t *root)
{
if (root == nil)
return 1 + verify_node_count(nil, root->left)
+ verify_node_count(nil, root->right);
}
+#endif
/*
* Verify that the tree contains the given node. This is done by
int dict_verify(dict_t *dict)
{
+#ifdef EXTREME_DICT_DEBUG
dnode_t *nil = dict_nil(dict), *root = dict_root(dict);
/* check that the sentinel node and root node are black */
return 0;
if (verify_node_count(nil, root) != dict_count(dict))
return 0;
+#endif
return 1;
}
/* uncomment if you are a developer in bug hunt */
/* #define EXTREME_DEBUG */
-/* #define EXTREME_TLV_DEBUG */
+/* #define EXTREME_DICT_DEBUG */
struct isis {
u_long process_id;