use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putShortOffsettedBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void putShortOffsettedBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.putShort(i, (short) 1);
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putIntMustRespectOffsetIntoSecondCursor.
@Test
public void putIntMustRespectOffsetIntoSecondCursor() throws Exception {
second.setOffset(1);
PageCursor c = CompositePageCursor.compose(first, 4, second, 8);
c.putInt(1);
c.putInt(2);
assertThat(second.getInt(1), is(2));
assertThat(c.getInt(), is(0xB5B6B7B8));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getByteOffsettedBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void getByteOffsettedBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.getByte(i);
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putIntMustHitFirstCursorBeforeFlip.
@Test
public void putIntMustHitFirstCursorBeforeFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 4, second, 4);
c.putInt(1);
c.setOffset(0);
assertThat(c.getInt(), is(1));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putByteMustHitFirstCursorBeforeFlip.
@Test
public void putByteMustHitFirstCursorBeforeFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 1, second, 1);
c.putByte((byte) 1);
c.setOffset(0);
assertThat(c.getByte(), is((byte) 1));
assertFalse(c.checkAndClearBoundsFlag());
}
Aggregations