#include <cassert> #include <iostream> #include "IntStack.h" using namespace std; int main() { IntStack st( 1 ); assert( st.capacity() == 1 ); st.push( 100 ); assert( st.capacity() == 1 ); assert( st.size() == 1 ); st.push( 200 ); assert( st.capacity() == 2 ); assert( st.size() == 2 ); assert( st.top() == 200 ); st.pop(); assert( st.top() == 100 ); st.double_capacity(); assert( st.capacity() == 2*2 ); assert( st.size() == 1 ); IntStack st100; assert( st100.capacity() == IntStack::DEFAULT_STACK_CAPACITY ); assert( st100.size() == 0 ); return 0; }