| 278 | } |
| 279 | |
| 280 | static void testStop(bool success, bool jump, int x, int y) { |
| 281 | const MockGame mg(MockMap::ePassBlock20x15); |
| 282 | |
| 283 | auto& ch = *MockGame::GetEvent(1); |
| 284 | ch.SetX(x); |
| 285 | ch.SetY(y); |
| 286 | ch.SetStopCount(99); |
| 287 | ch.SetMaxStopCount(200); |
| 288 | |
| 289 | if (jump) { |
| 290 | REQUIRE_EQ(ch.Jump(x + 1, y + 1), success); |
| 291 | } else { |
| 292 | REQUIRE_EQ(ch.Move(Up), success); |
| 293 | } |
| 294 | |
| 295 | REQUIRE_EQ(ch.GetStopCount(), 99); |
| 296 | REQUIRE_EQ(ch.GetMaxStopCount(), 200); |
| 297 | } |
| 298 | |
| 299 | TEST_CASE("StopCountMove") { testStop(true, false, 4, 4); } |
| 300 | TEST_CASE("StopCountMoveFail") { testStop(false, false, 16, 16); } |
no test coverage detected