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

Class NodeTest

tests/node_test.cpp:30–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29template <typename T>
30class NodeTest : public testing::Test {
31 public:
32 using NodeType = T;
33 using Allocator = typename T::alloc_type;
34 void CreateNode(NodeType& node, Allocator& a) {
35 node.SetObject();
36 {
37 /*
38 {
39 "String":"Hello World!",
40 "Double":1.0,
41 "Int":1,
42 "True":true,
43 "False":false,
44 "Null":null,
45 "Object":{
46 "New_object":{
47 "String":"Hello World!",
48 "Double":1.0,
49 "Int":1,
50 "True":true,
51 "False":false,
52 "Null":null,
53 "Object":{},
54 "Array":[]
55 }
56 },
57 "Array":[
58 {
59 "String":"Hello World!",
60 "Double":1.0,
61 "Int":1,
62 "True":true,
63 "False":false,
64 "Null":null,
65 "Object":{
66 "New_object":{
67 "String":"Hello World!",
68 "Double":1.0,
69 "Int":1,
70 "True":true,
71 "False":false,
72 "Null":null,
73 "Object":{},
74 "Array":[]
75 }
76 },
77 "Array":[]
78 }
79 ],
80 "EString":"",
81 "EObject":{},
82 "EArray":[]
83 }
84 */
85 NodeType node_obj(kObject);
86 node_obj.AddMember("String", NodeType("Hello World!", a), a);
87 node_obj.AddMember("Double", NodeType(1.0), a);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected