| 186 | } |
| 187 | |
| 188 | TEST(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 | |
| 232 | TEST(S6ImportExportAdvanceTicks, all) |
| 233 | { |
nothing calls this directly
no test coverage detected