summaryrefslogtreecommitdiffstats
path: root/test/test_filesystem.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-24 10:55:38 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 10:57:59 -0500
commitd338f4afed7ddafa718cb58ef893ca074fa69f79 (patch)
tree1565947540d982fa1e914e4fbd8ee5ce00a13d72 /test/test_filesystem.c
parentd1adb25160e49b49f886999e5c3fedf968514700 (diff)
downloadzix-d338f4afed7ddafa718cb58ef893ca074fa69f79.tar.gz
zix-d338f4afed7ddafa718cb58ef893ca074fa69f79.tar.bz2
zix-d338f4afed7ddafa718cb58ef893ca074fa69f79.zip
Improve test coverage
Diffstat (limited to 'test/test_filesystem.c')
-rw-r--r--test/test_filesystem.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/test_filesystem.c b/test/test_filesystem.c
index 0c775d1..d57dc3f 100644
--- a/test/test_filesystem.c
+++ b/test/test_filesystem.c
@@ -261,9 +261,7 @@ test_copy_file(const char* data_file_path)
assert(tmp_file_path);
assert(copy_path);
- if (!data_file_path) {
- data_file_path = tmp_file_path;
- }
+ data_file_path = data_file_path ? data_file_path : tmp_file_path;
assert(!write_to_path(tmp_file_path, "test\n"));
@@ -696,10 +694,11 @@ int
main(const int argc, char** const argv)
{
// Try to find some existing data file that's ideally not on a tmpfs
- const char* data_file_path = (argc > 1) ? argv[1] : "build.ninja";
- if (zix_file_type(data_file_path) != ZIX_FILE_TYPE_REGULAR) {
- data_file_path = NULL;
- }
+ const char* const default_file_path = (argc > 1) ? argv[1] : "build.ninja";
+ const char* const data_file_path =
+ (zix_file_type(default_file_path) == ZIX_FILE_TYPE_REGULAR)
+ ? default_file_path
+ : NULL;
test_temp_directory_path();
test_current_path();