| 103 | |
| 104 | template < typename Out, typename T > |
| 105 | Out test_growable( const T &foo ) |
| 106 | { |
| 107 | std::ofstream output{ "name", std::ofstream::binary }; |
| 108 | geode::TContext context_output{}; |
| 109 | geode::Serializer serializer{ context_output, output }; |
| 110 | serializer.object( foo ); |
| 111 | serializer.adapter().flush(); |
| 112 | |
| 113 | std::ifstream input{ "name", std::ifstream::binary }; |
| 114 | geode::TContext context_input{}; |
| 115 | geode::Deserializer deserializer{ context_input, input }; |
| 116 | Out new_foo; |
| 117 | deserializer.object( new_foo ); |
| 118 | const auto &adapter = deserializer.adapter(); |
| 119 | geode::OpenGeodeBasicException::test( |
| 120 | adapter.error() == bitsery::ReaderError::NoError |
| 121 | && adapter.isCompletedSuccessfully(), |
| 122 | "Error while reading file" ); |
| 123 | return new_foo; |
| 124 | } |
| 125 | |
| 126 | void test() |
| 127 | { |