MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / AtPointerHelper

Function AtPointerHelper

tests/node_test.cpp:333–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331
332template <typename StringType, typename NodeType>
333void AtPointerHelper(const NodeType& obj) {
334 EXPECT_TRUE(
335 obj.template AtPointer<StringType>({"Object", "New_object", "Double"})
336 ->IsDouble());
337 EXPECT_TRUE(
338 obj.template AtPointer<StringType>({"Array", 0, "String"})->IsString());
339 EXPECT_TRUE(obj.template AtPointer<StringType>({0}) == nullptr);
340 EXPECT_TRUE(obj.template AtPointer<StringType>({"Unknown"}) == nullptr);
341 EXPECT_TRUE(obj.template AtPointer<StringType>(
342 {"Object", "Array", 1, "Double"}) == nullptr);
343 EXPECT_TRUE(obj.template AtPointer<StringType>({"EArray", 0}) == nullptr);
344 EXPECT_TRUE(obj.template AtPointer<StringType>({"EArray", -1}) == nullptr);
345 EXPECT_TRUE(obj.template AtPointer<StringType>({"Object", 0}) == nullptr);
346}
347
348TYPED_TEST(NodeTest, AtPointer) {
349 using NodeType = TypeParam;

Callers

nothing calls this directly

Calls 2

IsDoubleMethod · 0.80
IsStringMethod · 0.80

Tested by

no test coverage detected