129130131132133134135136137
// Errors - IllegalArgumentException @Test(expected=BufferException.class) public void ptrbuffer09() { PtrBuffer pb = make(4,5) ; contains(pb, 2, 4, 6, 8) ; pb.shiftDown(4) ; }
137138139140141142143144145
} @Test(expected=BufferException.class) public void ptrbuffer10() { PtrBuffer pb = make(4,5) ; contains(pb, 2, 4, 6, 8) ; pb.shiftUp(4) ; }
145146147148149150151152153
} @Test(expected=BufferException.class) public void ptrbuffer11() { PtrBuffer pb = make(5,5) ; contains(pb, 2, 4, 6, 8, 10) ; pb.add(12) ; }
153154155156157158159160161162163164
} // Copy, duplicate, clear @Test public void ptrbuffer12() { PtrBuffer pb = make(5,5) ; contains(pb, 2, 4, 6, 8, 10) ; PtrBuffer pb2 = pb.duplicate() ; pb2.set(1, 99) ; contains(pb, 2, 4, 6, 8, 10) ; contains(pb2, 2, 99, 6, 8, 10) ; }
163164165166167168169170171172
contains(pb2, 2, 99, 6, 8, 10) ; } @Test public void ptrbuffer13() { PtrBuffer pb = make(5,5) ; contains(pb, 2, 4, 6, 8, 10) ; pb.clear(1, 3) ; contains(pb, 2, -1, -1, -1, 10) ; }
171172173174175176177178179180181182183184
contains(pb, 2, -1, -1, -1, 10) ; } @Test public void ptrbuffer14() { PtrBuffer pb = make(5,5) ; contains(pb, 2, 4, 6, 8, 10) ; PtrBuffer pb2 = make(5,5) ; contains(pb2, 2, 4, 6, 8, 10) ; pb.copy(0, pb2, 1, 4) ; contains(pb2, 2, 2, 4, 6, 8) ; }
185186187188189190191192193194195196197198199200201202
// Remove tests @Test public void ptrbuffer15() { PtrBuffer pb = make(5,5) ; contains(pb, 2, 4, 6, 8, 10) ; pb.removeTop() ; contains(pb, 2, 4, 6, 8) ; pb.remove(1) ; contains(pb, 2, 6, 8) ; pb.remove(2) ; contains(pb, 2, 6) ; pb.remove(0) ; contains(pb, 6) ; pb.remove(0) ; contains(pb) ; }
201202203204205206207208209210211212213
contains(pb) ; } @Test public void ptrbuffer20() { PtrBuffer pb1 = make(5,5) ; contains(pb1, 2, 4, 6, 8, 10) ; PtrBuffer pb2 = make(0,5) ; contains(pb2) ; pb1.shiftRight(pb2) ; contains(pb1, 2, 4, 6, 8) ; contains(pb2, 10) ;
213214215216217218219220221222223224225
contains(pb2, 10) ; } @Test public void ptrbuffer21() { PtrBuffer pb1 = make(3,5) ; contains(pb1, 2, 4, 6) ; PtrBuffer pb2 = make(0,5) ; contains(pb2) ; pb1.shiftRight(pb2) ; contains(pb1, 2, 4) ; contains(pb2, 6) ;
225226227228229230231232233234235236237
contains(pb2, 6) ; } @Test public void ptrbuffer22() { PtrBuffer pb1 = make(3,5) ; contains(pb1, 2, 4, 6) ; PtrBuffer pb2 = make(2,5) ; contains(pb2, 2, 4) ; pb1.shiftRight(pb2) ; contains(pb1, 2, 4) ; contains(pb2, 6, 2, 4) ;