From b422366dd07a16b0de5c32c5e56c7b54ecd7d136 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Nov 2022 17:54:19 -0500 Subject: Use zix_create_directories() --- test/lilv_test_utils.c | 4 +--- test/test_filesystem.c | 33 --------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) (limited to 'test') diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index cca6ac9..260390f 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -3,8 +3,6 @@ #include "lilv_test_utils.h" -#include "../src/filesystem.h" - #include "lilv/lilv.h" #include "serd/serd.h" #include "zix/allocator.h" @@ -73,7 +71,7 @@ create_bundle(LilvTestEnv* env, zix_free(NULL, test_dir); } - if (lilv_create_directories(env->test_bundle_path)) { + if (zix_create_directories(NULL, env->test_bundle_path)) { fprintf(stderr, "Failed to create directory '%s' (%s)\n", env->test_bundle_path, diff --git a/test/test_filesystem.c b/test/test_filesystem.c index 25f73ec..301a3d2 100644 --- a/test/test_filesystem.c +++ b/test/test_filesystem.c @@ -283,38 +283,6 @@ test_create_temporary_directory(void) free(path1); } -static void -test_create_directories(void) -{ - char* const temp_dir = lilv_create_temporary_directory("lilvXXXXXX"); - - assert(lilv_is_directory(temp_dir)); - - char* const child_dir = zix_path_join(NULL, temp_dir, "child"); - char* const grandchild_dir = zix_path_join(NULL, child_dir, "grandchild"); - - assert(!lilv_create_directories(grandchild_dir)); - assert(lilv_is_directory(grandchild_dir)); - assert(lilv_is_directory(child_dir)); - - char* const file_path = zix_path_join(NULL, temp_dir, "lilv_test_file"); - FILE* const f = fopen(file_path, "w"); - - fprintf(f, "test\n"); - fclose(f); - - assert(lilv_create_directories(file_path)); - - assert(!zix_remove(file_path)); - assert(!zix_remove(grandchild_dir)); - assert(!zix_remove(child_dir)); - assert(!zix_remove(temp_dir)); - free(file_path); - free(child_dir); - free(grandchild_dir); - free(temp_dir); -} - int main(void) { @@ -329,7 +297,6 @@ main(void) test_flock(); test_dir_for_each(); test_create_temporary_directory(); - test_create_directories(); return 0; } -- cgit v1.2.1