Search in sources :

Example 1 with DynamicRecordFormat

use of org.neo4j.kernel.impl.store.format.standard.DynamicRecordFormat in project neo4j by neo4j.

the class BaseRecordFormatTest method shouldRecognizeDesignatedInUseBit.

@Test
void shouldRecognizeDesignatedInUseBit() {
    // GIVEN
    RecordFormat<DynamicRecord> format = new DynamicRecordFormat();
    PageCursor cursor = new StubPageCursor(0, 1_000);
    byte inUseByte = 0;
    for (int i = 0; i < 8; i++) {
        // WHEN
        cursor.setOffset(68);
        cursor.putByte(cursor.getOffset(), inUseByte);
        // THEN
        assertEquals(shouldBeInUse(inUseByte), format.isInUse(cursor));
        inUseByte <<= 1;
        inUseByte |= 1;
    }
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) DynamicRecordFormat(org.neo4j.kernel.impl.store.format.standard.DynamicRecordFormat) StubPageCursor(org.neo4j.io.pagecache.StubPageCursor) PageCursor(org.neo4j.io.pagecache.PageCursor) StubPageCursor(org.neo4j.io.pagecache.StubPageCursor) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 PageCursor (org.neo4j.io.pagecache.PageCursor)1 StubPageCursor (org.neo4j.io.pagecache.StubPageCursor)1 DynamicRecordFormat (org.neo4j.kernel.impl.store.format.standard.DynamicRecordFormat)1 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)1