Revisión | 1f1bb1b301eb57f165e35ef1eb1282c1c08c3351 (tree) |
---|---|
Tiempo | 2018-11-04 22:50:28 |
Autor | dhrname <dhrname@user...> |
Commiter | dhrname |
Modify the startest
@@ -737,44 +737,25 @@ int main(int argc, char **argv) | ||
737 | 737 | assert( ST_getLastChild(node3) == node4); |
738 | 738 | assert( ST_getPreviousNode(node4) == node41); |
739 | 739 | assert( ST_getPreviousNode(node41) == node2); |
740 | - ST_Node node5 = ST_copyNode(node3); | |
740 | + ST_Node node5 = ST_copyNode(node4); | |
741 | + assert(node5 != node4); | |
741 | 742 | assert( ST_isEmptyNode(ST_copyNode(ST_EMPTY_NODE)) ); |
742 | 743 | assert( ST_getNodeValue(node5) == valuedummy); |
743 | - /*assert( ST_getNodeValue(node5) != node2); | |
744 | - assert( ST_getLastChild(node5) != node2); | |
745 | - assert( ST_getLastChild(node5) != node3); | |
746 | - assert( ST_getPreviousNode(node5) == node3); | |
747 | - | |
748 | - /*node6 = node2*/ | |
749 | - /*ST_Node node6 = ST_getLastChild(node5); | |
750 | - assert( ST_getNodeValue(node6) == node); | |
751 | - assert( ST_isEmpty(ST_getLastChild(node6)) ); | |
752 | - assert( ST_isEmpty(ST_getPreviousNode(node6)) ); | |
753 | - | |
754 | - node6 = ST_createNode(ST_EMPTY, node5, node); | |
755 | - ST_Node node7 = ST_copyNode(node6, ST_EMPTY); | |
756 | - assert( ST_isEmpty(ST_getNodeValue(node7)) ); | |
757 | - assert( ST_getNodeValue(node7) != node2); | |
758 | - ST_Node cnode7 = ST_getLastChild(node7); | |
759 | - assert( cnode7 != node5); | |
760 | - assert( ST_getLastChild(cnode7) != ST_getLastChild(node5) ); | |
761 | - assert( ST_isEmpty(ST_getPreviousNode(node7))); | |
762 | - assert( ST_getPreviousNode(cnode7) != node3); | |
763 | - assert( ST_getNodeValue(ST_getPreviousNode(cnode7)) == ST_getNodeValue(node3)); | |
764 | - ST_Node rnode6 = ST_reverseNode(node6); | |
765 | - assert( ST_getNodeValue(rnode6) == ST_getNodeValue(node)); | |
766 | - assert( ST_getNodeValue(ST_getPreviousNode(rnode6)) == ST_getNodeValue(node6) ); | |
767 | - assert( ST_isEmpty(ST_setChurchNumber(2, ST_getPreviousNode, rnode6)) ); | |
768 | - */ | |
744 | + assert( ST_getLastChild(node5) != node4); | |
745 | + assert( ST_getNodeValue(ST_getLastChild(node5)) == ST_getNodeValue(node4)); | |
746 | + assert( ST_getPreviousNode(node5) != node41); | |
747 | + assert( ST_getNodeValue(ST_getPreviousNode(node5)) == ST_getNodeValue(node41)); | |
748 | + | |
749 | + | |
750 | + ST_Node node6 = ST_createNode(valuedummy); | |
751 | + | |
769 | 752 | ST_freenode(node); |
770 | 753 | ST_freenode(node2); |
771 | 754 | ST_freenode(node3); |
772 | 755 | ST_freenode(node4); |
773 | 756 | ST_freenode(node41); |
774 | - /*ST_freetree(node5); | |
775 | - ST_freetree(node6); | |
776 | - ST_freetree(node7); | |
777 | - ST_freetree(rnode6);*/ | |
757 | + ST_freenode(node5); | |
758 | + ST_freenode(node6); | |
778 | 759 | |
779 | 760 | errno = 0; |
780 | 761 | errno_before_eprint = UNKNOWN_ERROR; |
@@ -840,17 +821,17 @@ int tests_invalid() { | ||
840 | 821 | assert(tokens[1] == 0); |
841 | 822 | assert(tokens[2] == 0); |
842 | 823 | |
843 | - assert(ST_isEmpty(ST_eval(ST_EMPTY, NULL))); | |
844 | - assert(ST_isEmpty(ST_eval(ST_EMPTY, ST_EMPTY))); | |
845 | - assert(ST_isEmpty(ST_eval(ST_EMPTY, btree))); | |
846 | - assert(ST_isEmpty(ST_eval(ST_EMPTY, btree))); | |
824 | + assert(ST_isEmptyNode(ST_eval(ST_EMPTY, NULL))); | |
825 | + assert(ST_isEmptyNode(ST_eval(ST_EMPTY, ST_EMPTY_NODE))); | |
826 | + assert(ST_isEmptyNode(ST_eval(ST_EMPTY, btree))); | |
827 | + assert(ST_isEmptyNode(ST_eval(ST_EMPTY, btree))); | |
847 | 828 | |
848 | - assert(ST_isEmpty(ST_reverse(NULL))); | |
849 | - assert(ST_isEmpty(ST_reverse(ST_EMPTY))); | |
829 | + assert(ST_isEmptyNode(ST_reverse(NULL))); | |
830 | + assert(ST_isEmptyNode(ST_reverse(ST_EMPTY_NODE))); | |
850 | 831 | |
851 | 832 | ST_createNode(NULL); |
852 | 833 | ST_createNode(NULL); |
853 | - ST_createNode(ST_EMPTY_NODE); | |
834 | + ST_createNode(ST_EMPTY); | |
854 | 835 | |
855 | 836 | assert( ST_isEmpty(ST_getNodeValue(NULL)) ); |
856 | 837 | assert( ST_isEmptyNode(ST_getLastChild(NULL)) ); |