You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
863 B
36 lines
863 B
#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
|