| 13 | TEST_SUITE_BEGIN("Game_Character_Move"); |
| 14 | |
| 15 | static void testChar( |
| 16 | const Game_Character& ch, |
| 17 | int x, int y, |
| 18 | int dir, int face, |
| 19 | int remaining_step, |
| 20 | bool is_jumping, |
| 21 | int begin_jump_x, int begin_jump_y, |
| 22 | int frequency, int speed, |
| 23 | int stop_count, int max_stop_count) |
| 24 | { |
| 25 | CAPTURE(x); |
| 26 | CAPTURE(y); |
| 27 | CAPTURE(dir); |
| 28 | CAPTURE(face); |
| 29 | CAPTURE(remaining_step); |
| 30 | CAPTURE(is_jumping); |
| 31 | CAPTURE(begin_jump_x); |
| 32 | CAPTURE(begin_jump_y); |
| 33 | CAPTURE(frequency); |
| 34 | CAPTURE(speed); |
| 35 | CAPTURE(stop_count); |
| 36 | CAPTURE(max_stop_count); |
| 37 | |
| 38 | REQUIRE_EQ(ch.GetX(), x); |
| 39 | REQUIRE_EQ(ch.GetY(), y); |
| 40 | REQUIRE_EQ(ch.GetDirection(), dir); |
| 41 | REQUIRE_EQ(ch.GetFacing(), face); |
| 42 | REQUIRE_EQ(ch.GetRemainingStep(), remaining_step); |
| 43 | REQUIRE_EQ(ch.IsJumping(), is_jumping); |
| 44 | REQUIRE_EQ(ch.GetBeginJumpX(), begin_jump_x); |
| 45 | REQUIRE_EQ(ch.GetBeginJumpY(), begin_jump_y); |
| 46 | REQUIRE_EQ(ch.GetRemainingStep(), remaining_step); |
| 47 | REQUIRE_EQ(ch.GetMoveFrequency(), frequency); |
| 48 | REQUIRE_EQ(ch.GetMoveSpeed(), speed); |
| 49 | REQUIRE_EQ(ch.GetStopCount(), stop_count); |
| 50 | REQUIRE_EQ(ch.GetMaxStopCount(), max_stop_count); |
| 51 | REQUIRE_EQ(ch.GetMoveRouteIndex(), 0); |
| 52 | REQUIRE_EQ(ch.IsMoveRouteOverwritten(), false); |
| 53 | REQUIRE_EQ(ch.IsMoveRouteFinished(), false); |
| 54 | REQUIRE_EQ(ch.GetMoveRoute(), lcf::rpg::MoveRoute()); |
| 55 | |
| 56 | REQUIRE_EQ(ch.IsStopCountActive(), stop_count < max_stop_count); |
| 57 | |
| 58 | if (remaining_step > 0) { |
| 59 | REQUIRE(!ch.IsStopping()); |
| 60 | REQUIRE_EQ(ch.IsJumping(), is_jumping); |
| 61 | REQUIRE_EQ(ch.IsMoving(), !is_jumping); |
| 62 | } else { |
| 63 | REQUIRE(ch.IsStopping()); |
| 64 | REQUIRE(!ch.IsJumping()); |
| 65 | REQUIRE(!ch.IsMoving()); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | template <bool success> |
| 70 | static void testMove(int move_dir, int x, int y, int dir, int face, |
no test coverage detected