diff options
Diffstat (limited to 'tests/server/util.c')
-rw-r--r-- | tests/server/util.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/server/util.c b/tests/server/util.c index 169ca5bcb..f576b9c23 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -194,11 +194,21 @@ void win32_cleanup(void) /* set by the main code to point to where the test dir is */ const char *path = "."; -char *test2file(long testno) +FILE *test2fopen(long testno) { - static char filename[256]; + FILE *stream; + char filename[256]; + /* first try the alternative, preprocessed, file */ + msnprintf(filename, sizeof(filename), ALTTEST_DATA_PATH, path, testno); + stream = fopen(filename, "rb"); + if(stream) + return stream; + + /* then try the source version */ msnprintf(filename, sizeof(filename), TEST_DATA_PATH, path, testno); - return filename; + stream = fopen(filename, "rb"); + + return stream; } /* |