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.

32 lines
556 B

  1. #include "unity.h"
  2. #include "ggT.h"
  3. void setUp(){}
  4. void tearDown(){}
  5. // Test for Common Case
  6. void test_ggTOf5And10(){
  7. TEST_ASSERT_EQUAL_INT(5, ggT(5, 10));
  8. }
  9. // Tests for Cases with Zero in input
  10. void test_ggTOfFirstNumberZero(){
  11. TEST_ASSERT_EQUAL_INT(5, ggT(0, 5));
  12. }
  13. void test_ggTOfSecondNumberZero(){
  14. TEST_ASSERT_EQUAL_INT(10, ggT(10, 0));
  15. }
  16. void test_ggTOfBothNumbersZero(){
  17. TEST_ASSERT_EQUAL_INT(0, ggT(0, 0));
  18. }
  19. // Test for edge Case - Coprime Numbers
  20. void test_ggTOfCoprimes(){
  21. TEST_ASSERT_EQUAL_INT(1, ggT(13, 27));
  22. }