Skip to content

Commit ea47b79

Browse files
committed
Fix test ignored in previous commit
1 parent 05d7bb3 commit ea47b79

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/test/java/org/lmdbjava/ByteBufferProxyTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
import static java.nio.ByteBuffer.allocate;
2929
import static java.nio.ByteBuffer.allocateDirect;
3030
import jnr.ffi.Pointer;
31+
import jnr.ffi.provider.MemoryManager;
3132
import static org.hamcrest.CoreMatchers.is;
3233
import static org.hamcrest.CoreMatchers.not;
3334
import static org.hamcrest.CoreMatchers.notNullValue;
3435
import static org.hamcrest.CoreMatchers.startsWith;
3536
import static org.hamcrest.MatcherAssert.assertThat;
36-
import org.junit.Ignore;
3737
import org.junit.Rule;
3838
import org.junit.Test;
3939
import org.junit.rules.TemporaryFolder;
40+
import static org.lmdbjava.BufferProxy.MDB_VAL_STRUCT_SIZE;
4041
import static org.lmdbjava.ByteBufferProxy.AbstractByteBufferProxy.findField;
4142
import org.lmdbjava.ByteBufferProxy.BufferMustBeDirectException;
4243
import static org.lmdbjava.ByteBufferProxy.PROXY_OPTIMAL;
@@ -53,6 +54,8 @@
5354
*/
5455
public final class ByteBufferProxyTest {
5556

57+
static final MemoryManager MEM_MGR = RUNTIME.getMemoryManager();
58+
5659
@Rule
5760
public final TemporaryFolder tmp = new TemporaryFolder();
5861

@@ -91,7 +94,6 @@ public void inOutBuffersProxyOptimal() {
9194
}
9295

9396
@Test
94-
@Ignore("Fails; requires investigation")
9597
public void inOutBuffersProxySafe() {
9698
checkInOut(PROXY_SAFE);
9799
}
@@ -126,7 +128,7 @@ private void checkInOut(final BufferProxy<ByteBuffer> v) {
126128
b.flip();
127129
b.position(BYTES); // skip 1
128130

129-
final Pointer p = RUNTIME.getMemoryManager().allocateTemporary(1, false);
131+
final Pointer p = MEM_MGR.allocateTemporary(MDB_VAL_STRUCT_SIZE, false);
130132
v.in(b, p, p.address());
131133

132134
final ByteBuffer bb = allocateDirect(1);

0 commit comments

Comments
 (0)