| 360 | } |
| 361 | |
| 362 | static void testBoat(Game_Vehicle::Type vt, AnimType at, int speed, bool move, bool jump, bool flying) { |
| 363 | const MockGame mg(map_id); |
| 364 | |
| 365 | auto& ch = *mg.GetVehicle(vt); |
| 366 | if (flying) { |
| 367 | ch.SetFlying(flying); |
| 368 | } |
| 369 | |
| 370 | auto limit = move ? 12 : 16; |
| 371 | |
| 372 | CAPTURE(vt); |
| 373 | CAPTURE(at); |
| 374 | CAPTURE(speed); |
| 375 | |
| 376 | if (vt == Game_Vehicle::Airship && !ch.IsFlying()) { |
| 377 | testAnimFixed(ch); |
| 378 | return; |
| 379 | } |
| 380 | |
| 381 | if (jump) { |
| 382 | testAnimJump(ch); |
| 383 | return; |
| 384 | } |
| 385 | |
| 386 | for (int i = 0; i < 255; ++i) { |
| 387 | if (move) { |
| 388 | // HACK To make stop count increment to 0 each frame to emulate movement |
| 389 | // FIXME: Verify this matches movement |
| 390 | ch.SetStopCount(-1); |
| 391 | } |
| 392 | |
| 393 | auto count = i % limit; |
| 394 | auto frame = ((i / limit) + 1) % 4; |
| 395 | testChar(ch, count, frame); |
| 396 | ForceUpdate(ch); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | TEST_CASE("BoatShipStanding") { |
| 401 | for (int speed = 1; speed <= 6; ++speed) { |
no test coverage detected