}
pageChanges.addChanges(9, new byte[] { 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114 }, new byte[] {
-1, 0, 1, 2, 3, -2, 4, 5, 6, 7, -3, 8, 9, 10, 11 });
ODirectMemoryPointer pointer = new ODirectMemoryPointer(1024 + ODurablePage.PAGE_PADDING);
pageChanges.applyChanges(pointer);
Assert.assertEquals(pointer.get(9 + ODurablePage.PAGE_PADDING, 15), new byte[] { 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 114 });
for (byte i = 3; i < 17; i++) {
Assert.assertEquals(pointer.get(i * 10 + ODurablePage.PAGE_PADDING, 4), new byte[] { i, (byte) (i + 1), (byte) (i + 2),
(byte) (i + 3) });
}
pageChanges.revertChanges(pointer);
Assert.assertEquals(pointer.get(9 + ODurablePage.PAGE_PADDING, 15), new byte[] { -1, 3, 2, 1, 0, -2, 7, 6, 5, 4, -3, 11, 10, 9,
8 });
for (byte i = 3; i < 17; i++) {
Assert.assertEquals(pointer.get(i * 10 + ODurablePage.PAGE_PADDING, 4), new byte[] { (byte) (i + 3), (byte) (i + 2),
(byte) (i + 1), i });
}
pointer.free();
}