Lines Matching refs:node
53 assert_ptr_null(tree_first(&tree), "Unexpected node");
54 assert_ptr_null(tree_last(&tree), "Unexpected node");
58 assert_ptr_null(tree_search(&tree, &key), "Unexpected node");
62 assert_ptr_null(tree_nsearch(&tree, &key), "Unexpected node");
66 assert_ptr_null(tree_psearch(&tree, &key), "Unexpected node");
71 tree_recurse(node_t *node, unsigned black_height, unsigned black_depth)
77 if (node == NULL)
80 left_node = rbtn_left_get(node_t, link, node);
81 right_node = rbtn_right_get(node_t, link, node);
83 if (!rbtn_red_get(node_t, link, node))
87 if (rbtn_red_get(node_t, link, node)) {
90 "Node should be black");
93 "Node should be black");
97 assert_u32_eq(node->magic, NODE_MAGIC, "Bad magic");
115 tree_iterate_cb(tree_t *tree, node_t *node, void *data)
120 assert_u32_eq(node->magic, NODE_MAGIC, "Bad magic");
123 search_node = tree_search(tree, node);
124 assert_ptr_eq(search_node, node,
125 "tree_search() returned unexpected node");
128 search_node = tree_nsearch(tree, node);
129 assert_ptr_eq(search_node, node,
130 "tree_nsearch() returned unexpected node");
133 search_node = tree_psearch(tree, node);
134 assert_ptr_eq(search_node, node,
135 "tree_psearch() returned unexpected node");
165 node_remove(tree_t *tree, node_t *node, unsigned nnodes)
170 tree_remove(tree, node);
173 search_node = tree_nsearch(tree, node);
175 assert_u64_ge(search_node->key, node->key,
180 search_node = tree_psearch(tree, node);
182 assert_u64_le(search_node->key, node->key,
186 node->magic = 0;
192 "Unexpected node iteration count");
194 "Unexpected node iteration count");
198 remove_iterate_cb(tree_t *tree, node_t *node, void *data)
201 node_t *ret = tree_next(tree, node);
203 node_remove(tree, node, *nnodes);
209 remove_reverse_iterate_cb(tree_t *tree, node_t *node, void *data)
212 node_t *ret = tree_prev(tree, node);
214 node_remove(tree, node, *nnodes);
220 destroy_cb(node_t *node, void *data)
277 "Unexpected node iteration count");
279 "Unexpected node iteration count");