Tser can now output wstring and already saves wstring, so now need to use it.

This commit is contained in:
Zed A. Shaw 2024-11-04 23:58:56 -05:00
parent b113b90257
commit babc190525
2 changed files with 8 additions and 2 deletions

View file

@ -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);
}