summaryrefslogtreecommitdiff
path: root/source/tests
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-15 15:25:10 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-15 15:25:10 +0200
commitc163144c683ec0d0cddaf162353a08e235ef8200 (patch)
tree7d32fd1e44a14065cd6734c40204de64dc1ed14b /source/tests
parent792066308352552f541781bde2c1ba1db9690c56 (diff)
downloadkit-c163144c683ec0d0cddaf162353a08e235ef8200.zip
shared_memory: mingw fix
Diffstat (limited to 'source/tests')
-rw-r--r--source/tests/test_interprocess.c10
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);