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

Function testPos

tests/game_player_input.cpp:18–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16// FIXME: Test conditions which disable input
17
18static void testPos(Game_Player& ch, int x, int y,
19 int dir, int face,
20 int remaining_step, bool jumping,
21 int stop_count, int max_stop_count,
22 int total_encounter_rate, bool encounter_calling,
23 bool menu_calling,
24 int vehicle, bool boarding, bool aboard)
25{
26
27 REQUIRE_EQ(ch.GetX(), x);
28 REQUIRE_EQ(ch.GetY(), y);
29 REQUIRE_EQ(ch.GetDirection(), dir);
30 REQUIRE_EQ(ch.GetFacing(), face);
31 REQUIRE_EQ(ch.GetRemainingStep(), remaining_step);
32 REQUIRE_EQ(ch.IsJumping(), jumping);
33 REQUIRE_EQ(ch.GetStopCount(), stop_count);
34 REQUIRE_EQ(ch.GetMaxStopCount(), max_stop_count);
35 REQUIRE_EQ(ch.GetTotalEncounterRate(), total_encounter_rate);
36 REQUIRE_EQ(ch.IsEncounterCalling(), encounter_calling);
37 REQUIRE_EQ(ch.IsMenuCalling(), menu_calling);
38 REQUIRE_EQ(ch.GetVehicleType(),vehicle);
39 REQUIRE_EQ(ch.IsBoardingOrUnboarding(), boarding);
40 REQUIRE_EQ(ch.IsAboard(), aboard);
41}
42
43static void testMove(bool success, int input_dir, int dir, int x, int y, int dx, int dy, bool cheat, bool debug) {
44 DebugGuard dg(debug);

Callers 4

testMoveFunction · 0.85
testDecisionFunction · 0.85
testMenuFunction · 0.85

Calls 14

GetFacingMethod · 0.80
GetRemainingStepMethod · 0.80
IsJumpingMethod · 0.80
GetStopCountMethod · 0.80
GetMaxStopCountMethod · 0.80
GetTotalEncounterRateMethod · 0.80
IsEncounterCallingMethod · 0.80
IsMenuCallingMethod · 0.80
GetXMethod · 0.45
GetYMethod · 0.45
GetDirectionMethod · 0.45

Tested by

no test coverage detected