Browse Source

change direction right S --> W

main^2
Joe Lukas Kalb 11 months ago
committed by Peter Wiebe
parent
commit
766953d531
  1. 3
      src/main/c/labyrinth.c
  2. 14
      src/test/c/test_labyrinth.c

3
src/main/c/labyrinth.c

@ -13,5 +13,8 @@ void turn_direction_right(Direction *direction){
case E: case E:
*direction = S; *direction = S;
break; break;
case S:
*direction = W;
break;
} }
} }

14
src/test/c/test_labyrinth.c

@ -37,3 +37,17 @@ void test_turn_direction_right_from_E_expected_S(void)
/* assert */ /* assert */
TEST_ASSERT_TRUE(expected == actual); 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);
}
Loading…
Cancel
Save