From a571ef920196e8f51c1457067a55689f10d6266c Mon Sep 17 00:00:00 2001 From: fdai8040 Date: Sun, 4 Feb 2024 14:38:38 +0000 Subject: [PATCH] refactoring: optimierung_schleife --- test/Pong/test_clearScreen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Pong/test_clearScreen.c b/test/Pong/test_clearScreen.c index e859d99..f2701a1 100644 --- a/test/Pong/test_clearScreen.c +++ b/test/Pong/test_clearScreen.c @@ -18,10 +18,10 @@ void test_clearScreen(void){ /* arrange */ int i, j; for (i = 0; i < TEST_SCREEN_HEIGHT; i++) { - for (j = 0; j < TEST_SCREEN_WIDTH+1; j++) { - screen[i][j] = 'X'; + for (j = 0; j < TEST_SCREEN_WIDTH; j++) { + screen[i][j] = ' '; } - screen[i][j-1] = '\0'; + screen[i][j] = '\0'; } /* act */ @@ -29,7 +29,7 @@ void test_clearScreen(void){ /* assert */ for (i = 0; i < TEST_SCREEN_HEIGHT; i++) { - for (j = 0; j < TEST_SCREEN_WIDTH+1; j++) { + for (j = 0; j < TEST_SCREEN_WIDTH; j++) { TEST_ASSERT_EQUAL_INT(' ', screen[i][j]); } }