From 9d4ba68d90b8769545b464d77ea290e453bf1f1f Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 18:16:33 +0100 Subject: [PATCH] change direction right S --> W --- src/main/c/labyrinth.c | 3 +++ src/test/c/test_labyrinth.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index adaaab5..d53c95b 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -13,5 +13,8 @@ void turn_direction_right(Direction *direction){ case E: *direction = S; break; + case S: + *direction = W; + break; } } diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index 563d886..555736d 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -37,3 +37,17 @@ void test_turn_direction_right_from_E_expected_S(void) /* assert */ TEST_ASSERT_TRUE(expected == actual); } + +void test_turn_direction_right_from_S_expected_W(void) +{ + /* arrange */ + Direction actual = S; + Direction expected = W; + + /* act */ + turn_direction_right(&actual); + + /* assert */ + TEST_ASSERT_TRUE(expected == actual); +} +