|
|
|
@ -82,13 +82,14 @@ struct Pixel { |
|
|
|
|
|
|
|
|
|
struct Robot { |
|
|
|
|
Pixel point; |
|
|
|
|
std::wstring name; |
|
|
|
|
std::optional<Item> item; |
|
|
|
|
|
|
|
|
|
DEFINE_SERIALIZABLE(Robot, point, item); |
|
|
|
|
DEFINE_SERIALIZABLE(Robot, point, name, item); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
TEST_CASE("test using tser for serialization", "[config]") { |
|
|
|
|
auto robot = Robot{ Pixel{3,4}, Item::RADAR}; |
|
|
|
|
auto robot = Robot{ Pixel{3,4}, L"BIG NAME", Item::RADAR}; |
|
|
|
|
std::cout << robot << '\n'; |
|
|
|
|
|
|
|
|
|
tser::BinaryArchive archive; |
|
|
|
@ -101,5 +102,6 @@ TEST_CASE("test using tser for serialization", "[config]") { |
|
|
|
|
|
|
|
|
|
REQUIRE(loadedRobot.point.x == robot.point.x); |
|
|
|
|
REQUIRE(loadedRobot.point.y == robot.point.y); |
|
|
|
|
REQUIRE(loadedRobot.name == robot.name); |
|
|
|
|
REQUIRE(loadedRobot.item == robot.item); |
|
|
|
|
} |
|
|
|
|