MCPcopy Index your code
hub / github.com/java-native-access/jna / testSharedMemoryBounds

Method testSharedMemoryBounds

test/com/sun/jna/MemoryTest.java:70–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 public void testSharedMemoryBounds() {
71 Memory base = new Memory(16);
72 Pointer shared = base.share(4, 4);
73 shared.getInt(-4);
74 try {
75 shared.getInt(-8);
76 fail("Bounds check should fail");
77 }
78 catch(IndexOutOfBoundsException e) {
79 }
80 shared.getInt(8);
81 try {
82 shared.getInt(12);
83 fail("Bounds check should fail");
84 }
85 catch(IndexOutOfBoundsException e) {
86 }
87 }
88
89 public void testAlignment() {
90 final int SIZE = 1<<16;

Callers

nothing calls this directly

Calls 2

shareMethod · 0.95
getIntMethod · 0.95

Tested by

no test coverage detected