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.

43 lines
868 B

11 months ago
11 months ago
11 months ago
  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. char halloWelt4[]="Ha\n\nllo \r W el\r\r t ";
  8. void setUp(void)
  9. {
  10. }
  11. void tearDown(void)
  12. {
  13. }
  14. void test_inputHandling_deleteOneWhiteSpace(void)
  15. {
  16. deleteWhitespace(halloWelt, 10);
  17. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt);
  18. }
  19. void test_inputHandling_deleteTwoWhiteSpaces(void)
  20. {
  21. deleteWhitespace(halloWelt2, 11);
  22. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt2);
  23. }
  24. void test_inputHandling_deleteManyWhiteSpaces(void)
  25. {
  26. deleteWhitespace(halloWelt3, 16);
  27. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt3);
  28. }
  29. void test_inputHandling_deleteAllOtherCharacter(void)
  30. {
  31. deleteWhitespace(halloWelt4, 19);
  32. TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt4);
  33. }
  34. #endif // TEST