MCPcopy Create free account
hub / github.com/EasyRPG/Player / testMoveRouteJump

Function testMoveRouteJump

tests/move_route.cpp:98–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97template <typename... Args>
98static void testMoveRouteJump(const Game_Character& ch,
99 int x, int y, int remaining_step,
100 bool is_jumping, int begin_jump_x, int begin_jump_y,
101 Args&&... args) {
102
103 CAPTURE(x);
104 CAPTURE(y);
105 CAPTURE(remaining_step);
106 CAPTURE(is_jumping);
107 CAPTURE(begin_jump_x);
108 CAPTURE(begin_jump_y);
109
110 REQUIRE_EQ(ch.GetX(), x);
111 REQUIRE_EQ(ch.GetY(), y);
112 REQUIRE_GE(ch.GetRemainingStep(), 0);
113 REQUIRE_EQ(ch.GetRemainingStep(), remaining_step);
114
115 REQUIRE_EQ(ch.GetBeginJumpX(), begin_jump_x);
116 REQUIRE_EQ(ch.GetBeginJumpY(), begin_jump_y);
117
118 if (remaining_step > 0) {
119 REQUIRE_EQ(ch.IsJumping(), is_jumping);
120 REQUIRE_EQ(ch.IsMoving(), !is_jumping);
121 } else {
122 REQUIRE(ch.IsStopping());
123 REQUIRE(!ch.IsJumping());
124 REQUIRE(!ch.IsMoving());
125 }
126 testMoveRouteDir(ch, std::forward<Args>(args)...);
127}
128
129TEST_CASE("DefaultMoveRoute") {
130 auto ch = MoveRouteVehicle();

Callers 1

testJumpFunction · 0.85

Calls 9

testMoveRouteDirFunction · 0.85
GetRemainingStepMethod · 0.80
GetBeginJumpXMethod · 0.80
GetBeginJumpYMethod · 0.80
IsJumpingMethod · 0.80
IsMovingMethod · 0.80
IsStoppingMethod · 0.80
GetXMethod · 0.45
GetYMethod · 0.45

Tested by

no test coverage detected