| 210 | } |
| 211 | |
| 212 | static int _check_bst_after(struct rt_aspace *aspace, struct rt_varea *varea, int isdel) |
| 213 | { |
| 214 | rt_varea_t root = VAREA_ENTRY(aspace->tree.tree.root_node); |
| 215 | int height = _is_balanced(root); |
| 216 | |
| 217 | if (root) |
| 218 | RT_ASSERT(height); |
| 219 | |
| 220 | int prev_count = _count; |
| 221 | _start = 0; |
| 222 | _boundary = 0; |
| 223 | _count = 0; |
| 224 | _aspace_traversal(aspace, _check_asc_after, isdel ? NULL : varea); |
| 225 | _count = isdel ? _count : _count + 1; |
| 226 | |
| 227 | if (isdel) |
| 228 | { |
| 229 | RT_ASSERT(prev_count - 1 == _count); |
| 230 | } |
| 231 | else |
| 232 | { |
| 233 | RT_ASSERT(prev_count + 1 == _count); |
| 234 | } |
| 235 | |
| 236 | return 1; |
| 237 | } |
| 238 | |
| 239 | /* test library */ |
| 240 | #define RANDOM(n) (xrand() % (n)) |
no test coverage detected