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.

34 lines
431 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "calculatorSquare.c"
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. void test1_calculatorMultiply(void)
  11. {
  12. float p, a, e;
  13. p = 26.24;
  14. a = calculatorSquare(p);
  15. e = p * p;
  16. TEST_ASSERT_EQUAL_FLOAT(e, a);
  17. }
  18. void test2_calculatorMultiply(void)
  19. {
  20. float p, a, e;
  21. p = 5;
  22. a = calculatorSquare(p);
  23. e = p * p;
  24. TEST_ASSERT_EQUAL_FLOAT(e, a);
  25. }
  26. #endif // TEST