diff --git a/data/test-misc.json b/data/test-misc.json index 83d6e44..994bf5e 100644 --- a/data/test-misc.json +++ b/data/test-misc.json @@ -54,10 +54,20 @@ "description": "Write and read a text on the (named) shared memory", "tags": ["Windows System", "IPC(Inter-Process Communication)"] }, - { - "id": "sharedmemory_listener", - "description": "Read a text form the (named) shared memory, Repeatly", + { + "id": "sharedmemory_write", + "description": "Write a text to the (named) shared memory", "tags": ["Windows System", "IPC(Inter-Process Communication)"] - } + }, + { + "id": "sharedmemory_read", + "description": "Read a text from the (named) shared memory", + "tags": ["Windows System", "IPC(Inter-Process Communication)"] + }, + { + "id": "sharedmemory_listener", + "description": "Read a text from the (named) shared memory, Repeatly", + "tags": ["Windows System", "IPC(Inter-Process Communication)"] + } ] } diff --git a/testloader.js b/testloader.js index 864d6ee..2a270a4 100644 --- a/testloader.js +++ b/testloader.js @@ -847,7 +847,7 @@ var test_implements = { console.log("Writing a text the to shared memory..."); mem.writeText("nice meet you"); - console.log("Writing a text from the shared memory..."); + console.log("Reading a text from the shared memory..."); console.log(mem.readText() + ", too"); console.log("Cleaning the shared memory..."); @@ -859,6 +859,33 @@ var test_implements = { console.log("Done"); }, + + "sharedmemory_write": function() { + var Toolkit = require("lib/toolkit"); + var mem = new Toolkit.NamedSharedMemory("welsonjs_test"); + + console.log("Writing a text to the shared memory..."); + mem.writeText("nice meet you"); + + console.log("Done"); + }, + + "sharedmemory_read": function() { + var Toolkit = require("lib/toolkit"); + var mem = new Toolkit.NamedSharedMemory("welsonjs_test"); + + console.log("Reading a text from the shared memory..."); + console.log(mem.readText() + ", too"); + + console.log("Cleaning the shared memory..."); + mem.clear() + console.log(mem.readText()); + + mem.close() + console.log("Closing the shared memory..."); + + console.log("Done"); + }, "sharedmemory_listener": function() { var Toolkit = require("lib/toolkit");