MCPcopy Create free account
hub / github.com/baidu/babylon / TEST_F

Function TEST_F

test/serialization/test_compatible.cpp:25–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 BABYLON_COMPATIBLE((v, 1))
24};
25TEST_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
48struct StringSerializable {
49 ::std::string v;

Callers

nothing calls this directly

Calls 8

assignMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
frontMethod · 0.45
beginMethod · 0.45
insertMethod · 0.45
emplaceMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected