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

Function TEST

test/tests/S6ImportExportTests.cpp:188–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188TEST(S6ImportExportBasic, all)
189{
190 gOpenRCT2Headless = true;
191 gOpenRCT2NoGraphics = true;
192
193 MemoryStream importBuffer;
194 MemoryStream exportBuffer;
195 MemoryStream snapshotStream;
196
197 // Load initial park data.
198 {
199 std::unique_ptr<IContext> context = CreateContext();
200 EXPECT_NE(context, nullptr);
201
202 bool initialised = context->Initialise();
203 ASSERT_TRUE(initialised);
204
205 std::string testParkPath = TestData::GetParkPath("BigMapTest.sv6");
206 ASSERT_TRUE(LoadFileToBuffer(importBuffer, testParkPath));
207 ASSERT_TRUE(ImportS6(importBuffer, context, false));
208 RecordGameStateSnapshot(context, snapshotStream);
209
210 ASSERT_TRUE(ExportSave(exportBuffer, context));
211 }
212
213 // Import the exported version.
214 {
215 std::unique_ptr<IContext> context = CreateContext();
216 EXPECT_NE(context, nullptr);
217
218 bool initialised = context->Initialise();
219 ASSERT_TRUE(initialised);
220
221 ASSERT_TRUE(ImportPark(exportBuffer, context, true));
222
223 RecordGameStateSnapshot(context, snapshotStream);
224 }
225
226 snapshotStream.SetPosition(0);
227 CompareStates(importBuffer, exportBuffer, snapshotStream);
228
229 SUCCEED();
230}
231
232TEST(S6ImportExportAdvanceTicks, all)
233{

Callers

nothing calls this directly

Calls 15

CreateContextFunction · 0.85
GetParkPathFunction · 0.85
LoadFileToBufferFunction · 0.85
ImportS6Function · 0.85
RecordGameStateSnapshotFunction · 0.85
ExportSaveFunction · 0.85
ImportParkFunction · 0.85
CompareStatesFunction · 0.85
AdvanceGameTicksFunction · 0.85
DecryptSeaFunction · 0.85
SHA1Function · 0.85
InitialiseMethod · 0.45

Tested by

no test coverage detected