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.

40 lines
1.0 KiB

  1. #include "../src/arithmeticDivision.h"
  2. #include "unity.h"
  3. #include "limits.h"
  4. void setUp(void) {
  5. // set stuff up here
  6. }
  7. void tearDown(void) {
  8. // clean stuff up here
  9. }
  10. void test_arithmeticDivision_numberdividedbynumberequalsnumber(void) {
  11. int expectedResult = 2;
  12. int* result;
  13. result = division_integer(14, 7);
  14. TEST_ASSERT_EQUAL_INT(expectedResult, *result);
  15. }
  16. void test_arithmeticDivision_longdividedbylongequalscorrectlong(void) {
  17. long expectedResult = 5;
  18. long* result;
  19. result = division_long(10, 2);
  20. TEST_ASSERT_EQUAL_INT(expectedResult, *result);
  21. }
  22. void test_arithmeticDivsion_floatdividedbyfloatequalscorrectfloat(void) {
  23. float expectedResult = 5.0;
  24. float* result;
  25. result = division_float(10.0, 2.0);
  26. TEST_ASSERT_EQUAL_FLOAT(expectedResult, *result);
  27. }
  28. void test_arithmeticDivision_doubledividedbydoublequalscorrectdouble(void) {
  29. double expectedResult = 5.0;
  30. double* result;
  31. result = division_double(10.0, 2.0);
  32. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, *result);
  33. }