#include "../sequential/stack.hpp" #include "testutil.hpp" #include bool TestStack() { std::size_t testSize = 512ul; std::stack truth; Stack stack; for(std::size_t i = 0; i < testSize; ++i) { unsigned const toInsert = Util::GetRandomNumber(); truth.push(toInsert); stack.Push(toInsert); } while(!truth.empty()) { if(truth.top() != stack.Pop()) { return false; } truth.pop(); } return true; } int main() { Test::Execute(TestStack, "Pop push test"); return 0; }