diff --git a/src/calculatorSquare.c b/src/calculatorSquare.c new file mode 100644 index 0000000..e28cd3b --- /dev/null +++ b/src/calculatorSquare.c @@ -0,0 +1,9 @@ +#include "calculatorSquare.h" +// Note: +/* This Function may or may not be implemented in actual program, even if it is merged to the main branch. + If it is temporarily not included in the main Program, then this has a role in future Development of the Project */ + +float calculatorSquare(float num) +{ + return num*num; +} diff --git a/src/calculatorSquare.h b/src/calculatorSquare.h new file mode 100644 index 0000000..7f0efea --- /dev/null +++ b/src/calculatorSquare.h @@ -0,0 +1,8 @@ +#ifndef CALCULATORSQUARE_H +#define CALCULATORSQUARE_H +#include +#include +float calculatorSquare(float num); + + +#endif // CALCULATORSQUARE_H diff --git a/tests/test_calculatorSquare.c b/tests/test_calculatorSquare.c new file mode 100644 index 0000000..2a610f6 --- /dev/null +++ b/tests/test_calculatorSquare.c @@ -0,0 +1,36 @@ +#ifdef TEST + +#include "unity.h" + +#include "calculatorSquare.c" +// Note: +/* This Function may or may not be implemented in actual program, even if it is merged to the main branch. + If it is temporarily not included in the main Program, then this has a role in future Development of the Project */ + + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test1_calculatorMultiply(void) +{ + float num, actual, expected; //Arrange + num = 26.24; + expected = num * num; + actual = calculatorSquare(num); //Act + TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert +} + +void test2_calculatorMultiply(void) +{ + float num, actual, expected; //Arrange + num = 5; + expected = num * num; + actual = calculatorSquare(num); //Act + TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert +} +#endif // TEST