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