From 01fb0bf13194931a4367959e3096b845440e356d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 5 Feb 2026 20:51:45 +0000 Subject: [PATCH] test_stream: randomise filename Just to make sure it's not hardcoded or anything. --- test/test_stream.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/test_stream.c b/test/test_stream.c index 56ce471..b039b70 100644 --- a/test/test_stream.c +++ b/test/test_stream.c @@ -12,13 +12,19 @@ #include "./test.h" #include +#include -const char *valid_filename = "build/stream_test_artifact"; -FILE *valid_fp = NULL; -FILE *invalid_fp = NULL; +char valid_filename[24]; +FILE *valid_fp = NULL; +FILE *invalid_fp = NULL; void stream_test_prologue(void) { + valid_filename[ARRSIZE(valid_filename) - 1] = '\0'; + memcpy(valid_filename, "build/stream_test_", 18); + for (u64 i = 0; i < 5; ++i) + valid_filename[18 + i] = (rand() % 26) + 'a'; + TEST_INFO("Creating file named `%s`\n", valid_filename); valid_fp = fopen(valid_filename, "wb"); // This should do a few things for us