|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
|
#include "unity.h" |
|
|
#include "unity.h" |
|
|
|
|
|
|
|
|
#include "calculatorSquare.h" |
|
|
|
|
|
|
|
|
#include "calculatorSquare.c" |
|
|
|
|
|
|
|
|
void setUp(void) |
|
|
void setUp(void) |
|
|
{ |
|
|
{ |
|
@ -12,9 +12,23 @@ void tearDown(void) |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_calculatorSquare_NeedToImplement(void) |
|
|
|
|
|
|
|
|
void test1_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
TEST_IGNORE_MESSAGE("Need to Implement calculatorSquare"); |
|
|
|
|
|
|
|
|
float p, a, e; |
|
|
|
|
|
p = 26.24; |
|
|
|
|
|
a = calculatorSquare(p); |
|
|
|
|
|
e = p * p; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test2_calculatorMultiply(void) |
|
|
|
|
|
{ |
|
|
|
|
|
float p, a, e; |
|
|
|
|
|
p = 5; |
|
|
|
|
|
a = calculatorSquare(p); |
|
|
|
|
|
e = p * p; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |