mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 05:16:18 +08:00
27 lines
688 B
C++
27 lines
688 B
C++
#include <rfl.hpp>
|
|
#include <string>
|
|
|
|
#include "write_and_read.hpp"
|
|
|
|
namespace test_deque {
|
|
|
|
struct Person {
|
|
rfl::Rename<"firstName", std::string> first_name;
|
|
rfl::Rename<"lastName", std::string> last_name = "Simpson";
|
|
std::unique_ptr<std::deque<Person>> children;
|
|
};
|
|
|
|
TEST(generic, test_default_values) {
|
|
auto children = std::make_unique<std::deque<Person>>();
|
|
children->emplace_back(Person{.first_name = "Bart"});
|
|
children->emplace_back(Person{.first_name = "Lisa"});
|
|
children->emplace_back(Person{.first_name = "Maggie"});
|
|
|
|
const auto homer =
|
|
Person{.first_name = "Homer", .children = std::move(children)};
|
|
|
|
write_and_read(homer);
|
|
|
|
}
|
|
} // namespace test_deque
|