From 36f0b9cc01513061c5dade96fe2c0b8e1e31351f Mon Sep 17 00:00:00 2001 From: fdai8040 Date: Sun, 4 Feb 2024 14:19:14 +0000 Subject: [PATCH] refactoring: wertevergleich --- test/Pong/test_checkCollision.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Pong/test_checkCollision.c b/test/Pong/test_checkCollision.c index 74adc35..7d63643 100644 --- a/test/Pong/test_checkCollision.c +++ b/test/Pong/test_checkCollision.c @@ -32,7 +32,7 @@ void test_checkCollision(void){ // Test Ball trifft rechte und linke Wand ball.x = 0; int result1 = checkCollision(ball, paddle.y, paddle.y); - TEST_ASSERT_EQUAL_INT(1, result1); + TEST_ASSERT_EQUAL_INT(2, result1); ball.x = WIDTH - 1; int result2 = checkCollision(ball, paddle.y, paddle.y); @@ -42,22 +42,22 @@ void test_checkCollision(void){ ball.x = 5; ball.y = 0; int result3 = checkCollision(ball, paddle.y, paddle.y); - TEST_ASSERT_EQUAL_INT(0, result3); + TEST_ASSERT_EQUAL_INT(1, result3); ball.y = HEIGHT - 1; int result4 = checkCollision(ball, paddle.y, paddle.y); - TEST_ASSERT_EQUAL_INT(0, result4); + TEST_ASSERT_EQUAL_INT(1, result4); // Test wenn Ball Paddle trifft ball.x = paddle.x - 1; ball.y = paddle.y + 1; int result5 = checkCollision(ball, paddle.y, paddle.y); - TEST_ASSERT_EQUAL_INT(0, result5); + TEST_ASSERT_EQUAL_INT(1, result5); ball.x = paddle.x + 1; ball.y = paddle.y + 1; int result6 = checkCollision(ball, paddle.y, paddle.y); - TEST_ASSERT_EQUAL_INT(0, result6); + TEST_ASSERT_EQUAL_INT(1, result6); } #endif // TEST