Browse Source

change direction right E --> S

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

3
src/main/c/labyrinth.c

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

12
src/test/c/test_labyrinth.c

@ -25,3 +25,15 @@ void test_change_direction_from_N_expected_E(void)
TEST_ASSERT_TRUE(expected == actual); TEST_ASSERT_TRUE(expected == actual);
} }
void test_turn_direction_right_from_E_expected_S(void)
{
/* arrange */
Direction actual = E;
Direction expected = S;
/* act */
turn_direction_right(&actual);
/* assert */
TEST_ASSERT_TRUE(expected == actual);
}
Loading…
Cancel
Save