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

Function TEST_F

test/serialization/test_unique_ptr.cpp:20–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19struct NonSerializable {};
20TEST_F(UniquePtrTest, serializable_same_as_instance) {
21 ASSERT_FALSE(
22 SerializeTraits<::std::unique_ptr<NonSerializable>>::SERIALIZABLE);
23 {
24 using T = int;
25 using S = ::std::unique_ptr<T>;
26 ASSERT_TRUE(SerializeTraits<S>::SERIALIZABLE);
27 S s {new T(gen())};
28 ASSERT_TRUE(Serialization::serialize_to_string(s, string));
29 S ss;
30 ASSERT_TRUE(Serialization::parse_from_string(string, ss));
31 ASSERT_TRUE(ss);
32 ASSERT_EQ(*s, *ss);
33 }
34 {
35 using T = ::std::string;
36 using S = ::std::unique_ptr<T>;
37 ASSERT_TRUE(SerializeTraits<S>::SERIALIZABLE);
38 S s {new T(::std::to_string(gen()))};
39 ASSERT_TRUE(Serialization::serialize_to_string(s, string));
40 S ss;
41 ASSERT_TRUE(Serialization::parse_from_string(string, ss));
42 ASSERT_TRUE(ss);
43 ASSERT_EQ(*s, *ss);
44 }
45}
46
47TEST_F(UniquePtrTest, support_const_type) {
48 {

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected