MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_growable

Function test_growable

tests/basic/test-growable.cpp:105–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104template < typename Out, typename T >
105Out 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
126void test()
127{

Callers

nothing calls this directly

Calls 2

testFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected