From 9374e4f1cafd8e48fbdcb455dc6fbdd958a52b67 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Nov 2022 17:54:16 -0500 Subject: Use zix_remove() --- test/lilv_test_utils.c | 4 ++-- test/test_filesystem.c | 32 ++++++++++++++++---------------- test/test_state.c | 24 ++++++++++++------------ test/test_util.c | 7 ++++--- 4 files changed, 34 insertions(+), 33 deletions(-) (limited to 'test') diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index e924873..cca6ac9 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -142,11 +142,11 @@ void delete_bundle(LilvTestEnv* env) { if (env->test_content_path) { - lilv_remove(env->test_content_path); + zix_remove(env->test_content_path); } if (env->test_manifest_path) { - lilv_remove(env->test_manifest_path); + zix_remove(env->test_manifest_path); } if (env->test_bundle_path) { diff --git a/test/test_filesystem.c b/test/test_filesystem.c index 2057101..1ac4639 100644 --- a/test/test_filesystem.c +++ b/test/test_filesystem.c @@ -159,8 +159,8 @@ test_is_directory(void) assert(!lilv_is_directory(file_path)); // File - assert(!lilv_remove(file_path)); - assert(!lilv_remove(temp_dir)); + assert(!zix_remove(file_path)); + assert(!zix_remove(temp_dir)); free(file_path); free(temp_dir); @@ -193,9 +193,9 @@ test_copy_file(void) assert(lilv_copy_file(file_path, "/dev/full") == ENOSPC); } - assert(!lilv_remove(copy_path)); - assert(!lilv_remove(file_path)); - assert(!lilv_remove(temp_dir)); + assert(!zix_remove(copy_path)); + assert(!zix_remove(file_path)); + assert(!zix_remove(temp_dir)); free(copy_path); free(file_path); @@ -217,8 +217,8 @@ test_flock(void) fclose(f2); fclose(f1); - assert(!lilv_remove(file_path)); - assert(!lilv_remove(temp_dir)); + assert(!zix_remove(file_path)); + assert(!zix_remove(temp_dir)); free(file_path); free(temp_dir); } @@ -263,9 +263,9 @@ test_dir_for_each(void) (!strcmp(file_list.names[0], "lilv_test_2") && !strcmp(file_list.names[1], "lilv_test_1"))); - assert(!lilv_remove(path2)); - assert(!lilv_remove(path1)); - assert(!lilv_remove(temp_dir)); + assert(!zix_remove(path2)); + assert(!zix_remove(path1)); + assert(!zix_remove(temp_dir)); free(file_list.names[0]); free(file_list.names[1]); @@ -287,8 +287,8 @@ test_create_temporary_directory(void) assert(strcmp(path1, path2)); assert(lilv_is_directory(path2)); - assert(!lilv_remove(path2)); - assert(!lilv_remove(path1)); + assert(!zix_remove(path2)); + assert(!zix_remove(path1)); free(path2); free(path1); } @@ -315,10 +315,10 @@ test_create_directories(void) assert(lilv_create_directories(file_path)); - assert(!lilv_remove(file_path)); - assert(!lilv_remove(grandchild_dir)); - assert(!lilv_remove(child_dir)); - assert(!lilv_remove(temp_dir)); + 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); diff --git a/test/test_state.c b/test/test_state.c index e80ec89..26d8d97 100644 --- a/test/test_state.c +++ b/test/test_state.c @@ -148,7 +148,7 @@ remove_file(const char* path, const char* name, void* data) (void)data; char* const full_path = zix_path_join(NULL, path, name); - assert(!lilv_remove(full_path)); + assert(!zix_remove(full_path)); free(full_path); } @@ -159,11 +159,11 @@ cleanup_test_directories(const TestDirectories dirs) lilv_dir_for_each(dirs.copy, NULL, remove_file); lilv_dir_for_each(dirs.link, NULL, remove_file); - assert(!lilv_remove(dirs.link)); - assert(!lilv_remove(dirs.copy)); - assert(!lilv_remove(dirs.scratch)); - assert(!lilv_remove(dirs.shared)); - assert(!lilv_remove(dirs.top)); + assert(!zix_remove(dirs.link)); + assert(!zix_remove(dirs.copy)); + assert(!zix_remove(dirs.scratch)); + assert(!zix_remove(dirs.shared)); + assert(!zix_remove(dirs.top)); zix_free(NULL, dirs.link); zix_free(NULL, dirs.copy); @@ -663,8 +663,8 @@ test_to_files(void) lilv_instance_free(instance); lilv_dir_for_each(bundle_2_path, NULL, remove_file); lilv_dir_for_each(bundle_1_path, NULL, remove_file); - assert(!lilv_remove(bundle_2_path)); - assert(!lilv_remove(bundle_1_path)); + assert(!zix_remove(bundle_2_path)); + assert(!zix_remove(bundle_1_path)); cleanup_test_directories(dirs); zix_free(NULL, recfile_link_2); @@ -742,7 +742,7 @@ test_multi_save(void) lilv_instance_free(instance); lilv_dir_for_each(bundle_1_path, NULL, remove_file); - lilv_remove(bundle_1_path); + zix_remove(bundle_1_path); cleanup_test_directories(dirs); free(state_path); @@ -850,9 +850,9 @@ test_files_round_trip(void) lilv_dir_for_each(bundle_1_1_path, NULL, remove_file); lilv_dir_for_each(bundle_1_2_path, NULL, remove_file); lilv_dir_for_each(bundle_2_path, NULL, remove_file); - lilv_remove(bundle_1_1_path); - lilv_remove(bundle_1_2_path); - lilv_remove(bundle_2_path); + zix_remove(bundle_1_1_path); + zix_remove(bundle_1_2_path); + zix_remove(bundle_2_path); cleanup_test_directories(dirs); lilv_state_free(state_2_loaded); diff --git a/test/test_util.c b/test/test_util.c index 529719e..c228b8f 100644 --- a/test/test_util.c +++ b/test/test_util.c @@ -6,6 +6,7 @@ #include "../src/filesystem.h" #include "lilv/lilv.h" +#include "zix/filesystem.h" #include "zix/path.h" #include @@ -29,9 +30,9 @@ main(void) assert(lilv_copy_file(a_path, "not/a/dir/copy")); assert(!lilv_copy_file(a_path, "copy_c")); - assert(!lilv_remove(a_path)); - assert(!lilv_remove(b_path)); - assert(!lilv_remove(dir)); + assert(!zix_remove(a_path)); + assert(!zix_remove(b_path)); + assert(!zix_remove(dir)); lilv_free(b_path); lilv_free(a_path); -- cgit v1.2.1