| 23 | BABYLON_COMPATIBLE((v, 1)) |
| 24 | }; |
| 25 | TEST_F(SerializeTest, int) { |
| 26 | using S = IntSerializable; |
| 27 | S s; |
| 28 | |
| 29 | { |
| 30 | ::std::ifstream ifs("output/test/dump_int", ::std::ios_base::in); |
| 31 | if (ifs) { |
| 32 | string.assign(::std::istreambuf_iterator<char> {ifs}, {}); |
| 33 | ASSERT_TRUE(Serialization::parse_from_string(string, s)); |
| 34 | ASSERT_EQ(10086, s.v); |
| 35 | } else { |
| 36 | s.v = 10086; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | { |
| 41 | ASSERT_TRUE(Serialization::serialize_to_string(s, string)); |
| 42 | ::std::ofstream ofs("output/test/dump_int", |
| 43 | ::std::ios_base::out | ::std::ios_base::trunc); |
| 44 | ofs << string; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | struct StringSerializable { |
| 49 | ::std::string v; |