MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / testPushPop

Method testPushPop

test/tests/containers/TestStack.h:105–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 }
104
105 void testPushPop() {
106
107 Stack<int> stack1(mAllocator);
108 stack1.push(10);
109 rp3d_test(stack1.top() == 10);
110 stack1.push(80);
111 stack1.push(130);
112 rp3d_test(stack1.top() == 130);
113 rp3d_test(stack1.size() == 3);
114 rp3d_test(stack1.pop() == 130);
115 rp3d_test(stack1.pop() == 80);
116 rp3d_test(stack1.pop() == 10);
117 rp3d_test(stack1.size() == 0);
118 stack1.push(10);
119 rp3d_test(stack1.pop() == 10);
120 stack1.push(10);
121 stack1.push(80);
122 stack1.pop();
123 rp3d_test(stack1.pop() == 10);
124 rp3d_test(stack1.size() == 0);
125 stack1.push(10);
126 stack1.push(80);
127 stack1.push(130);
128 stack1.push(56);
129 stack1.push(89);
130 stack1.push(131);
131 stack1.clear();
132 rp3d_test(stack1.size() == 0);
133 }
134 };
135
136}

Callers

nothing calls this directly

Calls 4

pushMethod · 0.80
popMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected