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.

45 lines
841 B

  1. #include "unity.h"
  2. #include "kgV.h"
  3. #include "ggT.h"
  4. void setUp(void){}
  5. void tearDown(void){}
  6. // Tests for common Cases:
  7. void test_kgV8And6(void) {
  8. TEST_ASSERT_EQUAL_INT(24, kgV(8, 6));
  9. }
  10. void test_kgVOf2And17(){
  11. TEST_ASSERT_EQUAL_INT(34, kgV(2, 17));
  12. }
  13. // Tests for Cases with Zero in input:
  14. void test_kgVOfFirstNumberZero(){
  15. TEST_ASSERT_EQUAL_INT(0, kgV(0, 5));
  16. }
  17. void test_kgVOfSecondNumberZero(){
  18. TEST_ASSERT_EQUAL_INT(0, kgV(5, 0));
  19. }
  20. void test_kgVOfBothNumbersZero(){
  21. TEST_ASSERT_EQUAL_INT(0, kgV(0, 0));
  22. }
  23. // Tests for Cases with negative numbers
  24. void test_kgVOfFirstNumberNegative(){
  25. TEST_ASSERT_EQUAL_INT(34, kgV(-2, 17));
  26. }
  27. void test_kgVOfSecondNumberNegative(){
  28. TEST_ASSERT_EQUAL_INT(34, kgV(2, -17));
  29. }
  30. void test_kgVOfBothNumbersNegative(){
  31. TEST_ASSERT_EQUAL_INT(34, kgV(-2, -17));
  32. }