()
| 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; |