MCPcopy Create free account
hub / github.com/HelenOS/helenos / test_stack

Method test_stack

uspace/lib/cpp/src/__bits/test/adaptors.cpp:179–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177 }
178
179 void adaptors_test::test_stack()
180 {
181 std::stack<int> s{std::deque<int>{1}};
182
183 test_eq("stack initialized from deque top", s.top(), 1);
184 test_eq("stack initialized from deque size", s.size(), 1U);
185 test_eq("stack initialized from deque not empty", s.empty(), false);
186
187 s.push(2);
188 test_eq("stack push top", s.top(), 2);
189 test_eq("stack push size", s.size(), 2U);
190
191 s.pop();
192 test_eq("stack pop top", s.top(), 1);
193 test_eq("stack pop size", s.size(), 1U);
194 }
195}

Callers

nothing calls this directly

Calls 5

topMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected