mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 18:56:19 +08:00
@@ -1,9 +1,6 @@
|
||||
#include "test_custom_class1.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <rfl.hpp>
|
||||
#include <rfl/flexbuf.hpp>
|
||||
#include <source_location>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -14,9 +11,9 @@ namespace test_custom_class1 {
|
||||
|
||||
struct Person {
|
||||
struct PersonImpl {
|
||||
rfl::Field<"firstName", std::string> first_name;
|
||||
rfl::Field<"lastName", std::string> last_name = "Simpson";
|
||||
rfl::Field<"children", std::vector<Person>> children = rfl::default_value;
|
||||
rfl::Rename<"firstName", std::string> first_name;
|
||||
rfl::Rename<"lastName", std::string> last_name = "Simpson";
|
||||
std::vector<Person> children;
|
||||
};
|
||||
|
||||
using ReflectionType = PersonImpl;
|
||||
@@ -32,9 +29,7 @@ struct Person {
|
||||
PersonImpl impl;
|
||||
};
|
||||
|
||||
void test() {
|
||||
std::cout << std::source_location::current().function_name() << std::endl;
|
||||
|
||||
TEST(flexbuf, test_custom_class1) {
|
||||
const auto bart = Person("Bart");
|
||||
|
||||
write_and_read(bart);
|
||||
|
||||
Reference in New Issue
Block a user