From a505fe156ba508d200731bc0e8f54d87dc7c4a8c Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 10 Jun 2024 06:30:38 +0200 Subject: Cleanup --- source/tests/test_interprocess.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/tests/test_interprocess.c') diff --git a/source/tests/test_interprocess.c b/source/tests/test_interprocess.c index 7655192..027f4ae 100644 --- a/source/tests/test_interprocess.c +++ b/source/tests/test_interprocess.c @@ -21,7 +21,7 @@ int run_writer() { SZ(NAME), sizeof(shared_data_t), SHARED_MEMORY_CREATE); if (mem.status != KIT_OK) { - printf("%s: kit_shared_memory_open failed.\n", __FUNCTION__); + printf("Writer: kit_shared_memory_open failed.\n"); fflush(stdout); return 1; } @@ -52,7 +52,7 @@ int run_writer() { timespec_get(&t1, TIME_UTC); if (t1.tv_sec - t0.tv_sec > TIMEOUT) { - printf("%s: timeout.\n", __FUNCTION__); + printf("Writer: Timeout.\n"); shared_memory_close(&mem); return 1; } @@ -63,7 +63,7 @@ int run_writer() { shared_unlock(&p->m); if (shared_memory_close(&mem) != KIT_OK) { - printf("%s: kit_shared_memory_close failed.\n", __FUNCTION__); + printf("Writer: kit_shared_memory_close failed.\n"); fflush(stdout); return 1; } @@ -86,7 +86,7 @@ int run_reader() { timespec_get(&t1, TIME_UTC); if (t1.tv_sec - t0.tv_sec > TIMEOUT) { - printf("%s: timeout.\n", __FUNCTION__); + printf("Reader: Timeout.\n"); return 1; } @@ -104,7 +104,7 @@ int run_reader() { timespec_get(&t1, TIME_UTC); if (t1.tv_sec - t0.tv_sec > TIMEOUT) { - printf("%s: timeout.\n", __FUNCTION__); + printf("Reader: Timeout.\n"); return 1; } @@ -116,7 +116,7 @@ int run_reader() { for (i32 i = 0; i < DATA_SIZE; i++) if (p->bytes[i] != i) { - printf("%s: wrong byte %d\n", __FUNCTION__, i); + printf("Reader: Wrong byte %d\n", i); fflush(stdout); status = 1; } @@ -128,7 +128,7 @@ int run_reader() { unique_unlock(&p->m); if (shared_memory_close(&mem) != KIT_OK) { - printf("%s: kit_shared_memory_close failed.\n", __FUNCTION__); + printf("Reader: kit_shared_memory_close failed.\n"); fflush(stdout); status = 1; } @@ -154,7 +154,7 @@ int main(int argc, char **argv) { i64 sec = t1.tv_sec - t0.tv_sec; i64 nsec = t1.tv_nsec - t0.tv_nsec; - printf("Done in %.2lf msec\n", + printf("Writer: Done in %.2lf msec\n", (sec * 1000000000 + nsec) * 0.000001); fflush(stdout); -- cgit v1.2.3