File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #include < rfl.hpp>
2+ #include < rfl/cereal.hpp>
3+ #include < string>
4+
5+ #include " write_and_read.hpp"
6+
7+ namespace test_generic {
8+
9+ TEST (cereal, test_generic) {
10+ auto bart = rfl::Generic::Object ();
11+ bart[" first_name" ] = " Bart" ;
12+ bart[" last_name" ] = " Simpson" ;
13+ bart[" age" ] = 10 ;
14+
15+ auto lisa = rfl::Generic::Object ();
16+ lisa[" first_name" ] = " Lisa" ;
17+ lisa[" last_name" ] = " Simpson" ;
18+ lisa[" age" ] = 8 ;
19+
20+ auto maggie = rfl::Generic::Object ();
21+ maggie[" first_name" ] = " Lisa" ;
22+ maggie[" last_name" ] = " Simpson" ;
23+ maggie[" age" ] = 0 ;
24+
25+ auto homer = rfl::Generic::Object ();
26+ homer[" first_name" ] = " Lisa" ;
27+ homer[" last_name" ] = " Simpson" ;
28+ homer[" age" ] = 45 ;
29+ homer[" children" ] = rfl::Generic::Array ({bart, lisa, maggie});
30+
31+ write_and_read (homer);
32+ }
33+ } // namespace test_generic
You can’t perform that action at this time.
0 commit comments