|
@ -0,0 +1,44 @@ |
|
|
|
|
|
#ifdef TEST |
|
|
|
|
|
|
|
|
|
|
|
#include "unity.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "ProduktSumme.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setUp(void) |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void tearDown(void) |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_produkt_1(void) |
|
|
|
|
|
{ |
|
|
|
|
|
int result, expected = 1; |
|
|
|
|
|
|
|
|
|
|
|
result = berechneProdukt(1,1); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_Summe_1(void) |
|
|
|
|
|
{ |
|
|
|
|
|
int result, expected = 55; |
|
|
|
|
|
|
|
|
|
|
|
result = berechneSumme(1,10); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_Summe_2(void) |
|
|
|
|
|
{ |
|
|
|
|
|
int result, expected = 0; |
|
|
|
|
|
|
|
|
|
|
|
result = berechneSumme(5,2); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif //TEST |