Exemplo n.º 1
0
/**
 * pop() tests
 */
void testPop() {
  IntVector v;
  v.push(1);
  v.push(2);
  v.push(3);
  
  assert(v.pop() == 3);
  assert(v.pop() == 2);
  assert(v.pop() == 1);
  
  try {
    v.pop();
    fprintf(stderr, "Allowed pop on empty list.\n");
  } catch (OutOfBoundsException&) {
    // expected
  }
}