Skip to content

Commit e2cbf28

Browse files
committed
Loosen shm equivalency check between Python & Java
1 parent 68f630d commit e2cbf28

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/test/java/org/apposed/appose/SharedMemoryTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ public void testShmAttach() throws IOException {
123123
assertNotNull(shm);
124124
assertEquals(shmName, shm.name());
125125
assertEquals(shmRSize, shm.rsize());
126-
assertEquals(shmSize, shm.size());
126+
// Note: We do not test that shmSize and shm.size() match exactly,
127+
// because Python and appose-java's SharedMemory code will not
128+
// necessarily behave identically when it comes to block rounding.
129+
// Notably, on Windows, Python does not round, whereas ShmWindows
130+
// rounds up to the next block size (4K on GitHub Actions CI).
131+
assertTrue(shm.size() >= 345);
127132
ByteBuffer buf = shm.pointer().getByteBuffer(0, shmRSize);
128133
assertEquals(12, buf.get(0));
129134
assertEquals((byte) 234, buf.get(100));

0 commit comments

Comments
 (0)