MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / growing_tree

Function growing_tree

cp-profiler/src/cpprofiler/tests/tree_test.cpp:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void growing_tree()
73{
74
75 tree::Structure str;
76
77 auto root = str.createRoot(0);
78
79 auto n1 = str.addExtraChild(root);
80
81 assert(n1 == str.getChild(root, 0));
82
83 auto n2 = str.addExtraChild(root);
84
85 assert(n1 == str.getChild(root, 0));
86 assert(n2 == str.getChild(root, 1));
87
88 auto n3 = str.addExtraChild(root);
89
90 assert(n1 == str.getChild(root, 0));
91 assert(n2 == str.getChild(root, 1));
92 assert(n3 == str.getChild(root, 2));
93}
94
95void run()
96{

Callers 1

runFunction · 0.85

Calls 3

createRootMethod · 0.45
addExtraChildMethod · 0.45
getChildMethod · 0.45

Tested by

no test coverage detected