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.

36 lines
670 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "inputHandling.h"
  4. char halloWelt[]="Hallo Welt";
  5. char halloWelt2[]="Hallo Welt";
  6. char halloWelt3[]="Ha llo W el t ";
  7. void setUp(void)
  8. {
  9. }
  10. void tearDown(void)
  11. {
  12. }
  13. void test_inputHandling_deleteOneWhiteSpace(void)
  14. {
  15. deleteWhitespace(halloWelt, 10);
  16. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt);
  17. }
  18. void test_inputHandling_deleteTwoWhiteSpaces(void)
  19. {
  20. deleteWhitespace(halloWelt2, 11);
  21. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt2);
  22. }
  23. void test_inputHandling_deleteManyWhiteSpaces(void)
  24. {
  25. deleteWhitespace(halloWelt3, 16);
  26. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt3);
  27. }
  28. #endif // TEST