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