summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-12 17:54:19 -0500
committerDavid Robillard <d@drobilla.net>2022-11-16 10:22:55 -0500
commitb422366dd07a16b0de5c32c5e56c7b54ecd7d136 (patch)
tree58ba4280f3be8bdc47408c85e399273e24e90f70 /test
parent82ead5a276a9264a90a12afd120dc0bfaecba4b7 (diff)
downloadlilv-b422366dd07a16b0de5c32c5e56c7b54ecd7d136.tar.gz
lilv-b422366dd07a16b0de5c32c5e56c7b54ecd7d136.tar.bz2
lilv-b422366dd07a16b0de5c32c5e56c7b54ecd7d136.zip
Use zix_create_directories()
Diffstat (limited to 'test')
-rw-r--r--test/lilv_test_utils.c4
-rw-r--r--test/test_filesystem.c33
2 files changed, 1 insertions, 36 deletions
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;
}