Exam Flashcards
Two C Unit libraries.
include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
Syntax for run all tests function.
CU_initialize_registry();
CU_pSuite average_suite = CU_add_suite(“average_suite”, 0, 0);
CU_add_test(average_suite, “elements_dif_testcase”, elements_dif_testcase);//all elements are different
CU_pSuite maximum_suite = CU_add_suite(“maximum_suite”, 0, 0);
CU_add_test(maximum_suite, “elements_dif_testcase_max”, elements_dif_testcase_max);//all elements are different
CU_basic_run_tests();
CU_cleanup_registry();
Syntax for individual test case.
CU_ASSERT_EQUAL( function(parameters), expected answer);
MyRound function.
double my_round(double x, unsigned int digits) {
if (digits > 0) {
return my_round(x*10.0, digits-1)/10.0;
}
else {
return round(x);
}
}
LoadBoard From File Function
SaveBoard To File Function
EditName of List Function
Add List Function
Delete List Function
EditName of item function
Add item function
Delete item function
Print list function
Display Gantt function.
Test Gantt function.