// test02.cxx -- John Valois (valoisj@cs.rpi.edu)

// Test case to check correct detection of stack full condition.


#include <iostream>
#include "stack.h"

using std::cout;
using std::endl;


int main()
{
  cout << "test02: check for full stack... ";
  try 
  {
    stack<int> s;
    for (int i=0; i < s.max_size() + 1; ++ i)
      s.push(i);
  }
  catch (stack_full)
  {
    cout << "PASSED" << endl;
    return 0;
  }
  catch (...) 
  {
    cout << "FAILED (threw other exception)" << endl;
    return 1;
  }

  cout << "FAILED (no exception)" << endl;
  return 1;
}
