diff --git a/build-project.sh b/build-project.sh index 43a0588..51cf723 100755 --- a/build-project.sh +++ b/build-project.sh @@ -1,4 +1,5 @@ clear +ceedling test:all cd src/ gcc main.c -o main ./main diff --git a/tests/test_calculatorFactorial.c b/tests/test_calculatorFactorial.c index e2a176a..42af4ec 100644 --- a/tests/test_calculatorFactorial.c +++ b/tests/test_calculatorFactorial.c @@ -12,9 +12,68 @@ void tearDown(void) { } -void test_calculatorFactorial_NeedToImplement(void) +void test1_calculatorFactorial(void) { - TEST_IGNORE_MESSAGE("Need to Implement calculatorFactorial"); + int p, a, e; + p = 1; + e = 1; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); } +void test2_calculatorFactorial(void) +{ + int p, a, e; + p = 0; + e = 1; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + +void test3_calculatorFactorial(void) +{ + int p, a, e; + p = 3; + e = 6; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + +void test4_calculatorFactorial(void) +{ + int p, a, e; + p = 5; + e = 120; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + +void test5_calculatorFactorial(void) +{ + int p, a, e; + p = 8; + e = 40320; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + +void test6_calculatorFactorial(void) +{ + int p, a, e; + p = 11; + e = 39916800; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + +void test7_calculatorFactorial(void) +{ + int p, a, e; + p = 10; + e = 3628800; + a = calculatorFactorial(p); + TEST_ASSERT_EQUAL_INT(e, a); +} + + #endif // TEST