Browse Source

turn_direction_right W --> N

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

3
src/main/c/labyrinth.c

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

13
src/test/c/test_labyrinth.c

@ -51,3 +51,16 @@ void test_turn_direction_right_from_S_expected_W(void)
TEST_ASSERT_TRUE(expected == actual); TEST_ASSERT_TRUE(expected == actual);
} }
void test_turn_direction_right_from_W_expected_N(void)
{
/* arrange */
Direction actual = W;
Direction expected = N;
/* act */
turn_direction_right(&actual);
/* assert */
TEST_ASSERT_TRUE(expected == actual);
}
Loading…
Cancel
Save