MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / TEST

Function TEST

test/tests/MultiLaunch.cpp:25–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23constexpr int32_t updatesToTest = 10;
24
25TEST(MultiLaunchTest, all)
26{
27 std::string path = TestData::GetParkPath("bpb.sv6");
28
29 gOpenRCT2Headless = true;
30 gOpenRCT2NoGraphics = true;
31
32 for (int i = 0; i < 3; i++)
33 {
34 auto context = CreateContext();
35 bool initialised = context->Initialise();
36 ASSERT_TRUE(initialised);
37
38 GetContext()->LoadParkFromFile(path);
39 GameLoadInit();
40
41 // Check ride count to check load was successful
42 ASSERT_EQ(RideGetCount(), 134);
43
44 auto& date = getGameState().date;
45 // NOTE: This value is saved in the SV6 file, after the import this will be the current state.
46 // In case the save file gets replaced this needs to be adjusted.
47 ASSERT_EQ(date.GetMonthTicks(), 0x1e98);
48
49 for (int j = 0; j < updatesToTest; j++)
50 {
51 gameStateUpdateLogic();
52 }
53
54 ASSERT_EQ(date.GetMonthTicks(), 7862 + updatesToTest);
55
56 // Check ride count again
57 ASSERT_EQ(RideGetCount(), 134);
58 }
59 SUCCEED();
60}

Callers

nothing calls this directly

Calls 9

GetParkPathFunction · 0.85
CreateContextFunction · 0.85
GetContextFunction · 0.85
GameLoadInitFunction · 0.85
RideGetCountFunction · 0.85
gameStateUpdateLogicFunction · 0.85
GetMonthTicksMethod · 0.80
InitialiseMethod · 0.45
LoadParkFromFileMethod · 0.45

Tested by

no test coverage detected