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

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "calculatorSquare.c"
  4. // Note:
  5. /* This Function may or may not be implemented in actual program, even if it is merged to the main branch.
  6. If it is temporarily not included in the main Program, then this has a role in future Development of the Project */
  7. void setUp(void)
  8. {
  9. }
  10. void tearDown(void)
  11. {
  12. }
  13. void test1_calculatorMultiply(void)
  14. {
  15. float num, actual, expected; //Arrange
  16. num = 26.24;
  17. expected = num * num;
  18. actual = calculatorSquare(num); //Act
  19. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  20. }
  21. void test2_calculatorMultiply(void)
  22. {
  23. float num, actual, expected; //Arrange
  24. num = 5;
  25. expected = num * num;
  26. actual = calculatorSquare(num); //Act
  27. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  28. }
  29. #endif // TEST