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.

60 lines
877 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "division.h"
  4. #include "divsion.c"
  5. void setUp(void)
  6. {
  7. }
  8. void tearDown(void)
  9. {
  10. }
  11. void test_division_1(void)
  12. {
  13. int result, expected = 5;
  14. result = divisionInt(10,2);
  15. TEST_ASSERT_EQUAL_INT(expected, result);
  16. }
  17. void test_division_1_durch_0(void)
  18. {
  19. int result, expected = 0;
  20. result = divisionInt(10,0);
  21. TEST_ASSERT_EQUAL_INT(expected, result);
  22. }
  23. void test_division_2(void)
  24. {
  25. double result, expected = 5.0;
  26. result = divisionDouble(10.0,2.0);
  27. TEST_ASSERT_EQUAL_DOUBLE(expected, result);
  28. }
  29. void test_bitshift_druch_0(void)
  30. {
  31. int result, expected = 16;
  32. result = divisionByTwo(16,0);
  33. TEST_ASSERT_EQUAL_INT(expected, result);
  34. }
  35. void test_division_3(void)
  36. {
  37. int result, expected = 4;
  38. result = divisionByTwo(16,2);
  39. TEST_ASSERT_EQUAL_INT(expected, result);
  40. }
  41. #endif // TEST