mirror of
https://github.com/boostorg/contract.git
synced 2026-01-26 06:22:42 +00:00
27 lines
495 B
C++
27 lines
495 B
C++
|
|
//[meyer97_stack4_main
|
|
// File: stack4_main.cpp
|
|
#include "stack4.hpp"
|
|
#include <boost/detail/lightweight_test.hpp>
|
|
|
|
int main() {
|
|
stack4<int> s(3);
|
|
BOOST_TEST_EQ(s.capacity(), 3);
|
|
BOOST_TEST_EQ(s.count(), 0);
|
|
BOOST_TEST(s.empty());
|
|
BOOST_TEST(!s.full());
|
|
|
|
s.put(123);
|
|
BOOST_TEST(!s.empty());
|
|
BOOST_TEST(!s.full());
|
|
BOOST_TEST_EQ(s.item(), 123);
|
|
|
|
s.remove();
|
|
BOOST_TEST(s.empty());
|
|
BOOST_TEST(!s.full());
|
|
|
|
return boost::report_errors();
|
|
}
|
|
//]
|
|
|