use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getByteMustHitSecondCursorAfterFlip.
@Test
public void getByteMustHitSecondCursorAfterFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 1, second, 1);
assertThat(c.getByte(), is((byte) 0xA0));
assertThat(c.getByte(), is((byte) 0xB0));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putIntWithOffsetMustHitCorrectCursors.
@Test
public void putIntWithOffsetMustHitCorrectCursors() throws Exception {
first.setOffset(1);
second.setOffset(2);
PageCursor c = CompositePageCursor.compose(first, 2 * 4, second, 2 * 4);
c.putInt(4, 1);
c.putInt(4 + 4, 2);
assertThat(c.getInt(), is(0xA1A2A3A4));
assertThat(c.getInt(), is(1));
assertThat(c.getInt(), is(2));
assertThat(c.getInt(), is(0xB6B7B8B9));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putIntOffsettedBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void putIntOffsettedBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.putInt(i, 1);
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getShortMustRespectOffsetIntoSecondCursor.
@Test
public void getShortMustRespectOffsetIntoSecondCursor() throws Exception {
second.setOffset(1);
PageCursor c = CompositePageCursor.compose(first, 2, second, 2);
assertThat(c.getShort(), is((short) 0xA0A1));
assertThat(c.getShort(), is((short) 0xB1B2));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getShortMustHitSecondCursorAfterFlip.
@Test
public void getShortMustHitSecondCursorAfterFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 2, second, 2);
assertThat(c.getShort(), is((short) 0xA0A1));
assertThat(c.getShort(), is((short) 0xB0B1));
assertFalse(c.checkAndClearBoundsFlag());
}
Aggregations