示例#1
0
 void ch8_test() {
   testMergeTwoSortedLists();
   testReverseLinkedList();
   testHasCycle();
   testOverlappingNoCycleLists();
   testDeleteFromList();
   testRemoveKthLast();
   testRemoveDuplicates();
   testCyclicallyRightShiftList();
   testEvenOddMerge();
   testIsPalindrome();
   testPivotList();
   testAddNumbers();
 }
示例#2
0
文件: main.c 项目: pcblues/exercises
void doTests () {
    int pass = 1;
    pass = pass && testIsPalindrome(1,1);  // single digit
    pass = pass && testIsPalindrome(122,0); // odd length no
    pass = pass && testIsPalindrome(131,1); // odd length yes
    pass = pass && testIsPalindrome(134431,1);
    pass = pass && testIsPalindrome(134531,0);
    pass = pass && testIsPalindrome(123456,0);
    if (pass==1) {
        printf("All tests passed\n");
    } else printf("One test failed.\n");
}