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

Function testChar

tests/game_character_moveto.cpp:16–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static constexpr auto map_id = MockMap::ePassBlock20x15;
15
16static void testChar(const Game_Character& ch, int map_id, int x, int y,
17 int remaining_step, bool jumping,
18 int stop_count, int max_stop_count,
19 int anim_count, int anim_frame,
20 const std::string& sprite_graphic, int sprite_id) {
21 CAPTURE(map_id);
22 CAPTURE(x);
23 CAPTURE(y);
24 CAPTURE(remaining_step);
25 CAPTURE(jumping);
26 CAPTURE(stop_count);
27 CAPTURE(max_stop_count);
28 CAPTURE(anim_count);
29 CAPTURE(anim_frame);
30 CAPTURE(sprite_graphic);
31 CAPTURE(sprite_id);
32
33 REQUIRE_EQ(ch.GetMapId(), map_id);
34 REQUIRE_EQ(ch.GetX(), x);
35 REQUIRE_EQ(ch.GetY(), y);
36 REQUIRE_EQ(ch.GetRemainingStep(), remaining_step);
37 REQUIRE_EQ(ch.IsJumping(), jumping);
38 REQUIRE_EQ(ch.GetStopCount(), stop_count);
39 REQUIRE_EQ(ch.GetMaxStopCount(), max_stop_count);
40 REQUIRE_EQ(ch.GetAnimCount(), anim_count);
41 REQUIRE_EQ(ch.GetAnimFrame(), anim_frame);
42 REQUIRE_EQ(ch.GetSpriteName(), sprite_graphic);
43 REQUIRE_EQ(ch.GetSpriteIndex(), sprite_id);
44}
45
46static void testPlayer(Game_Player& ch) {
47 ch.SetRemainingStep(256);

Callers 2

testPlayerFunction · 0.70
testNonPlayerFunction · 0.70

Calls 11

GetRemainingStepMethod · 0.80
IsJumpingMethod · 0.80
GetStopCountMethod · 0.80
GetMaxStopCountMethod · 0.80
GetAnimCountMethod · 0.80
GetAnimFrameMethod · 0.80
GetMapIdMethod · 0.45
GetXMethod · 0.45
GetYMethod · 0.45
GetSpriteNameMethod · 0.45
GetSpriteIndexMethod · 0.45

Tested by

no test coverage detected