Added test_pop_excess

This commit is contained in:
John Wellbelove 2016-05-03 19:16:53 +01:00
parent 3a8cfda2c2
commit 8d59c170ef

View File

@ -179,6 +179,24 @@ namespace
CHECK_EQUAL(1U, stack.size());
}
//*************************************************************************
TEST(test_pop_excess)
{
etl::stack<int, 4> stack;
for (size_t i = 0; i < stack.max_size(); ++i)
{
stack.push(1);
}
for (size_t i = 0; i < stack.max_size(); ++i)
{
stack.pop();
}
CHECK_THROW(stack.pop(), etl::stack_empty);
}
//*************************************************************************
TEST(test_top)
{