|
@ -64,3 +64,20 @@ void test_turn_direction_right_from_W_expected_N(void) |
|
|
TEST_ASSERT_TRUE(expected == actual); |
|
|
TEST_ASSERT_TRUE(expected == actual); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_lab_move_from_1_1_N_expected_0_1(void) |
|
|
|
|
|
{ |
|
|
|
|
|
/* arrange */ |
|
|
|
|
|
unsigned short x = 1; |
|
|
|
|
|
unsigned short y = 1; |
|
|
|
|
|
Direction direction = N; |
|
|
|
|
|
|
|
|
|
|
|
unsigned short x_expected = 0; |
|
|
|
|
|
unsigned short y_expected = 1; |
|
|
|
|
|
|
|
|
|
|
|
/* act */ |
|
|
|
|
|
move(&x, &y, direction); |
|
|
|
|
|
|
|
|
|
|
|
/* assert */ |
|
|
|
|
|
TEST_ASSERT_TRUE(x == x_expected && y == y_expected); |
|
|
|
|
|
} |
|
|
|
|
|
|