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

Function TEST_F

test/serialization/test_serializer.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19BABYLON_REGISTER_SERIALIZER(int);
20
21TEST_F(SerializerTest, support_scalar) {
22 ASSERT_EQ(nullptr, Serialization::serializer_for_name("float"));
23 ASSERT_NE(nullptr, Serialization::serializer_for_name("int"));
24
25 int s = gen();
26 ASSERT_TRUE(Serialization::serialize_to_string(s, string));
27 Any ss;
28 auto serializer = Serialization::serializer_for_name("int");
29 ASSERT_TRUE(serializer->parse_from_string(string, ss));
30 ASSERT_TRUE(ss);
31 ASSERT_EQ(TypeId<int>::ID, ss.instance_type());
32 ASSERT_EQ(s, *ss.get<int>());
33}
34
35namespace user {
36struct BasicTypeSerializable {

Callers

nothing calls this directly

Calls 1

parse_from_stringMethod · 0.80

Tested by

no test coverage detected