diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/tests/test_interprocess.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/tests/test_interprocess.c b/source/tests/test_interprocess.c index fece68f..58044bf 100644 --- a/source/tests/test_interprocess.c +++ b/source/tests/test_interprocess.c @@ -5,13 +5,13 @@ #define NAME "kit_test_interprocess" -enum { SIZE = 64 }; +enum { DATA_SIZE = 64 }; enum { STATE_INIT, STATE_READY, STATE_DONE }; int run_writer() { kit_shared_memory_t mem = kit_shared_memory_open( - SZ(NAME), SIZE, KIT_SHARED_MEMORY_CREATE); + SZ(NAME), DATA_SIZE, KIT_SHARED_MEMORY_CREATE); if (mem.status != KIT_OK) { printf("%s: kit_shared_memory_open failed.\n", __FUNCTION__); @@ -20,7 +20,7 @@ int run_writer() { } mem.bytes[0] = STATE_INIT; - for (int i = 1; i < SIZE; i++) mem.bytes[i] = i; + for (int i = 1; i < DATA_SIZE; i++) mem.bytes[i] = i; mem.bytes[0] = STATE_READY; while (mem.bytes[0] != STATE_DONE) thrd_yield(); @@ -31,7 +31,7 @@ int run_writer() { int run_reader() { kit_shared_memory_t mem; for (;;) { - mem = kit_shared_memory_open(SZ(NAME), SIZE, + mem = kit_shared_memory_open(SZ(NAME), DATA_SIZE, KIT_SHARED_MEMORY_OPEN); if (mem.status == KIT_OK) break; @@ -48,7 +48,7 @@ int run_reader() { i32 status = 0; - for (i32 i = 1; i < SIZE; i++) + for (i32 i = 1; i < DATA_SIZE; i++) if (mem.bytes[i] != i) { printf("%s: wrong byte %d\n", __FUNCTION__, i); fflush(stdout); |