Skip to content

Commit

Permalink
Use appose's SharedMemory class to test shm logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed Sep 26, 2024
1 parent 8edbb18 commit 882fe1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/apposed/appose/SharedMemoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testShmCreate() throws IOException {

// Assert that another process is able to read the values.
String output = runPython(
"from multiprocessing.shared_memory import SharedMemory\n" +
"from appose import SharedMemory\n" +
"from sys import stdout\n" +
"shm = SharedMemory(name='" + shm.name() + "', size=" + size + ")\n" +
"matches = sum(1 for i in range(" + size + ") if shm.buf[i] == (" + size + " - i) % 256)\n" +
Expand All @@ -94,7 +94,7 @@ public void testShmAttach() throws IOException {
// program itself cannot read from stdin as a means of waiting for Java to
// signal its completion of the test asserts; we use a hacky sleep instead.
String output = runPython(
"from multiprocessing.shared_memory import SharedMemory\n" +
"from appose import SharedMemory\n" +
"from sys import stdout\n" +
"shm = SharedMemory(create=True, size=345)\n" +
"shm.buf[0] = 12\n" +
Expand Down

0 comments on commit 882fe1a

Please sign in to comment.