void test_isNodeRed_should_return_0_if_the_node_is_not_red_color(void){
    setNode(&node5,NULL,NULL,'b');
    setNode(&node30,NULL,NULL,'b');
    setNode(&node20,&node5,&node30,'d');
    Node *nodeA = &node5;
    Node *nodeB = &node30;
    Node *nodeC = &node20;
    TEST_ASSERT_EQUAL(0,isNodeRed(&nodeA));
    TEST_ASSERT_EQUAL(0,isNodeRed(&nodeB));
    TEST_ASSERT_EQUAL(0,isNodeRed(&nodeC));
}
Ejemplo n.º 2
0
void printTree(struct node * n) {
    if (n == NULL) return;
    printTree(getLeftChild(n));
    printf("%d(%s) ", n->key, isNodeRed(n) ? "red" : "black");
    printTree(n->right);
}