Example #1
0
/*--------------------------------------------------------
main
-----------------------------------------------------------------*/
int main() {
  test_factorial();
  test_num_binary_digit();
  test_fibonacci();
  test_hanoi();
  return 0 ;
}
Example #2
0
int main(int argc, char* argv[])
{
    testisPalindrome();
    
    
    ListNode *list = NULL;//(ListNode*)malloc(sizeof(ListNode));
    createList(&list);
    ListNode *list3 = reverseList_recursive(list);
    printList(list3);
  return 0;
    testlengthLongestSubString();
  //tetestreverseString();
  //testPrintParent();st_sqrt2();
    removeNthFromEnd(list, 4);
    //ListNode *list2 = reverseList(list);
    //removeOneNode(&list2, 11);
    /* ListNode *list3 = reverseBetween(list, 2,5); */
  testreverseString4();
  testcountNumWords();
  testreplaceSpace();
  testisSubstring();
//  test_atoi_();
  test_isPrime();
  test_pow_();
  test_typedef();
  test_addwithBinary();
  test_numZeros();
  test_fibonacci();
  test_sum2value();
  test_palindrom();
  test_bestStock();
  test_closeSQRT();
  test_reverse_int();
}
Example #3
0
int main(void)
{
    // Once you are done implementing the required functions, enable the testcases
#define TEST_PART1 1
#define TEST_PART2 1
#define TEST_PART3 1
#define TEST_PART4 1
#define TEST_PART5 1

    printf ("ICS 51, Lab 3 \nName: %s\nStudent ID: %s\n\n",yourName, yourStudentID);

#if TEST_PART1
    printf("====================== PART1 ======================\n");
    test_selectionSort();
    printf("\n");
#endif


#if TEST_PART2
    printf("====================== PART2 ======================\n");
    test_factorial();
    printf("\n");
#endif


#if TEST_PART3
    printf("====================== PART3 ======================\n");
    test_vectorOperations();
    printf("\n");
#endif


#if TEST_PART4
    printf("====================== PART4 ======================\n");
    test_changeCase();
    printf("\n");
#endif

#if TEST_PART5
    printf("====================== PART5 ======================\n");
    test_fibonacci();
    printf("\n");
#endif

    printf("===================== SUMMARY =====================\n");

    if (num_of_tests_passed == 0)
        printf(ANSI_COLOR_RED "All %d tests failed.\n\n" ANSI_COLOR_RESET, num_of_tests);
    else if (num_of_tests == num_of_tests_passed)
        printf(ANSI_COLOR_GREEN "All %d tests passed.\n\n" ANSI_COLOR_RESET, num_of_tests);
    else
        printf(ANSI_COLOR_YELLOW "%d out of %d tests passed.\n\n" ANSI_COLOR_RESET, num_of_tests_passed, num_of_tests);

    getchar();
    return 0;
}
Example #4
0
		void run()
		{
			test_n_sum();
			test_fibonacci();
			test_factors();
			test_reverse();
			test_palindrome();
			test_getDivisors();
			test_triangle();
			test_factorial();
			test_amicable();
			test_pandigital();
			test_reduce();
			if (passed)
			{
				std::cout << "BasicTest:: SUCCESS! All tests passed." << std::endl;
			}
			else
			{
				std::cout << "BasicTest:: !!!FAILURE!!! Tests failed." << std::endl;
			}
		}