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

Function testInitVehicle

tests/game_character.cpp:136–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136static void testInitVehicle(Game_Vehicle::Type vt) {
137 Game_Vehicle ch(vt);
138
139 testInit(ch);
140
141 REQUIRE_EQ(ch.GetDirection(), 3);
142 REQUIRE_EQ(ch.GetFacing(), 3);
143 if (vt == Game_Vehicle::Airship) {
144 REQUIRE_EQ(ch.GetMoveSpeed(), 5);
145 } else {
146 REQUIRE_EQ(ch.GetMoveSpeed(), 4);
147 }
148 REQUIRE(!ch.GetThrough());
149 REQUIRE_EQ(ch.GetLayer(), 1);
150 REQUIRE_EQ(ch.GetMoveFrequency(), 2);
151
152 REQUIRE_EQ(ch.GetVehicleType(), vt);
153 REQUIRE(!ch.IsAscending());
154 REQUIRE(!ch.IsDescending());
155 REQUIRE(!ch.IsAscendingOrDescending());
156 REQUIRE_EQ(ch.GetAltitude(), 0);
157 // FIXME: Player
158 //REQUIRE(!ch.IsInUse());
159 //REQUIRE(!ch.IsAboard());
160 // FIXME: Map
161 //REQUIRE(!ch.CanLand());
162 REQUIRE_EQ(ch.GetOrigSpriteName(), "");
163 REQUIRE_EQ(ch.GetOrigSpriteIndex(), 0);
164
165 REQUIRE_EQ(ch.GetMoveRoute(), lcf::rpg::MoveRoute());
166}
167
168TEST_CASE("InitVehicle") {
169 testInitVehicle(Game_Vehicle::Boat);

Callers 1

game_character.cppFile · 0.85

Calls 14

testInitFunction · 0.85
GetFacingMethod · 0.80
GetMoveSpeedMethod · 0.80
GetThroughMethod · 0.80
GetLayerMethod · 0.80
GetMoveFrequencyMethod · 0.80
IsAscendingMethod · 0.80
IsDescendingMethod · 0.80
GetAltitudeMethod · 0.80
GetOrigSpriteNameMethod · 0.80
GetOrigSpriteIndexMethod · 0.80

Tested by

no test coverage detected