From 71ba5642ae91d7ef7584e0788f716719ade312a5 Mon Sep 17 00:00:00 2001 From: wjf-hs Date: Tue, 2 Jul 2024 14:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E9=94=99=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_tree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_tree.c b/test/test_tree.c index cde98e2..b165529 100644 --- a/test/test_tree.c +++ b/test/test_tree.c @@ -132,16 +132,20 @@ static bool tree_rb_check_color(struct _tree *self, struct _tree_node* root, int { if(black_num != black_num_expected) { + printf("black_num != black_num_expected\n"); return false; } return true; } + if(root->color == RBT_BLACK) { black_num++; } + if(root->color == RBT_RED && root->parent && root->parent->color == RBT_RED) { + printf("The red node is adjacent to the red node\n"); return false; } return tree_rb_check_color(self, root->left, black_num, black_num_expected) &&