From df5a4a3af0fed08ef4a69312def6906d4df337ff Mon Sep 17 00:00:00 2001 From: fdai8040 Date: Sun, 4 Feb 2024 14:10:13 +0000 Subject: [PATCH] =?UTF-8?q?Gel=C3=B6scht=20test/Pong/test=5FupdateBallPosi?= =?UTF-8?q?tion.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Pong/test_updateBallPosition.c | 40 ----------------------------- 1 file changed, 40 deletions(-) delete mode 100644 test/Pong/test_updateBallPosition.c diff --git a/test/Pong/test_updateBallPosition.c b/test/Pong/test_updateBallPosition.c deleted file mode 100644 index 7c4d814..0000000 --- a/test/Pong/test_updateBallPosition.c +++ /dev/null @@ -1,40 +0,0 @@ -#ifdef TEST -#include "unity.h" -#include "pong.h" - -void updateBallPosition(Ball *ball) { - - ball->x += ball->speedX; - ball->y += ball->speedY; -} - -void setUp(void){ - //Wenn Funktion Vorraussetzungen braucht -} - -void tearDown(void){ -} - -void test_updateBallPosition(void){ - /* arrange */ - Ball ball; - ball.x = 10; - ball.y = 10; - ball.speedX = 1; - ball.speedY = 1; - int expectedX = ball.x + ball.speedX * 5; // erwartete Endposition nach 5 Schritten - int expectedY = ball.y + ball.speedY * 5; - - /* act */ - updateBallPosition(&ball); - updateBallPosition(&ball); - updateBallPosition(&ball); - updateBallPosition(&ball); - updateBallPosition(&ball); - - /* assert */ - TEST_ASSERT_EQUAL_INT(expectedX, ball.x); - TEST_ASSERT_EQUAL_INT(expectedY, ball.y); -} - -#endif // TEST