MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / test_gamestate_serialization

Function test_gamestate_serialization

tests/test_serialize.cpp:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool test_gamestate_serialization(OpenApoc::sp<OpenApoc::GameState> state)
53{
54
55 std::stringstream ss;
56 ss << "openapoc_test_serialize-" << std::this_thread::get_id();
57 auto tempPath = fs::temp_directory_path() / ss.str();
58 OpenApoc::UString pathString(tempPath.string());
59 LogInfo("Writing temp state to \"%s\"", pathString);
60 if (!test_gamestate_serialization_roundtrip(state, pathString))
61 {
62 LogWarning("Packed save test failed");
63 return false;
64 }
65
66 fs::remove(tempPath);
67
68 return true;
69}
70
71int main(int argc, char **argv)
72{

Callers 1

mainFunction · 0.85

Calls 2

removeFunction · 0.85

Tested by

no test coverage detected