@@ -0,0 +1,3258 @@
+package com.io7m.jcanephora;%0A%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.ByteOrder;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport com.io7m.jaux.Constraints.ConstraintError;%0Aimport com.io7m.jaux.RangeInclusive;%0A%0Apublic class ByteBufferCursorReadableIndexTest%0A%7B%0A  @SuppressWarnings(%22static-method%22) @Test public%0A    void%0A    testReadWriteByteIdentity()%0A      throws ConstraintError%0A  %7B%0A    final int element_count = 4;%0A    final GLUnsignedType type = GLUnsignedType.TYPE_UNSIGNED_BYTE;%0A    final int element_size = GLUnsignedTypeMeta.getSizeBytes(type);%0A%0A    final ByteBuffer data =%0A      ByteBuffer.allocate(element_count * element_size).order(%0A        ByteOrder.nativeOrder());%0A%0A    final ByteBufferCursorWritableIndex cw =%0A      new ByteBufferCursorWritableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    final ByteBufferCursorReadableIndex cr =%0A      new ByteBufferCursorReadableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    cw.putIndex(5);%0A    cw.putIndex(7);%0A    cw.putIndex(9);%0A    cw.putIndex(11);%0A%0A    Assert.assertTrue(5 == cr.getIndex());%0A    Assert.assertTrue(7 == cr.getIndex());%0A    Assert.assertTrue(9 == cr.getIndex());%0A    Assert.assertTrue(11 == cr.getIndex());%0A  %7D%0A%0A  @SuppressWarnings(%22static-method%22) @Test public%0A    void%0A    testReadWriteIntIdentity()%0A      throws ConstraintError%0A  %7B%0A    final int element_count = 4;%0A    final GLUnsignedType type = GLUnsignedType.TYPE_UNSIGNED_INT;%0A    final int element_size = GLUnsignedTypeMeta.getSizeBytes(type);%0A%0A    final ByteBuffer data =%0A      ByteBuffer.allocate(element_count * element_size).order(%0A        ByteOrder.nativeOrder());%0A%0A    final ByteBufferCursorWritableIndex cw =%0A      new ByteBufferCursorWritableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    final ByteBufferCursorReadableIndex cr =%0A      new ByteBufferCursorReadableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    cw.putIndex(5);%0A    cw.putIndex(7);%0A    cw.putIndex(9);%0A    cw.putIndex(11);%0A%0A    Assert.assertTrue(5 == cr.getIndex());%0A    Assert.assertTrue(7 == cr.getIndex());%0A    Assert.assertTrue(9 == cr.getIndex());%0A    Assert.assertTrue(11 == cr.getIndex());%0A  %7D%0A%0A  @SuppressWarnings(%22static-method%22) @Test public%0A    void%0A    testReadWriteShortIdentity()%0A      throws ConstraintError%0A  %7B%0A    final int element_count = 4;%0A    final GLUnsignedType type = GLUnsignedType.TYPE_UNSIGNED_SHORT;%0A    final int element_size = GLUnsignedTypeMeta.getSizeBytes(type);%0A%0A    final ByteBuffer data =%0A      ByteBuffer.allocate(element_count * element_size).order(%0A        ByteOrder.nativeOrder());%0A%0A    final ByteBufferCursorWritableIndex cw =%0A      new ByteBufferCursorWritableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    final ByteBufferCursorReadableIndex cr =%0A      new ByteBufferCursorReadableIndex(data, new RangeInclusive(%0A        0,%0A        element_count - 1), type);%0A%0A    cw.putIndex(5);%0A    cw.putIndex(7);%0A    cw.putIndex(9);%0A    cw.putIndex(11);%0A%0A    Assert.assertTrue(5 == cr.getIndex());%0A    Assert.assertTrue(7 == cr.getIndex());%0A    Assert.assertTrue(9 == cr.getIndex());%0A    Assert.assertTrue(11 == cr.getIndex());%0A  %7D%0A%7D%0A

Add readable cursor test