summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-12 17:54:22 -0500
committerDavid Robillard <d@drobilla.net>2022-11-16 10:22:55 -0500
commita2d40769d25c9495edce67be67be0ac36491ce80 (patch)
tree05eaa386cb4cfc8fb0531e940153bf3816994824 /test
parent31da12734905888bb13f0ee832b62d39f2d52eb6 (diff)
downloadlilv-a2d40769d25c9495edce67be67be0ac36491ce80.tar.gz
lilv-a2d40769d25c9495edce67be67be0ac36491ce80.tar.bz2
lilv-a2d40769d25c9495edce67be67be0ac36491ce80.zip
Use zix_copy_file()
Diffstat (limited to 'test')
-rw-r--r--test/test_filesystem.c38
-rw-r--r--test/test_util.c4
2 files changed, 0 insertions, 42 deletions
diff --git a/test/test_filesystem.c b/test/test_filesystem.c
index 01ccd5d..021d66f 100644
--- a/test/test_filesystem.c
+++ b/test/test_filesystem.c
@@ -11,7 +11,6 @@
#include "zix/path.h"
#include <assert.h>
-#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -157,42 +156,6 @@ test_is_directory(void)
}
static void
-test_copy_file(void)
-{
- char* const temp_dir = lilv_create_temporary_directory("lilvXXXXXX");
- char* const file_path = zix_path_join(NULL, temp_dir, "lilv_test_file");
- char* const copy_path = zix_path_join(NULL, temp_dir, "lilv_test_copy");
-
- FILE* f = fopen(file_path, "w");
- fprintf(f, "test\n");
- fclose(f);
-
- assert(!lilv_copy_file(file_path, copy_path));
- assert(zix_file_equals(NULL, file_path, copy_path));
-
- if (zix_file_type("/dev/full") != ZIX_FILE_TYPE_NONE) {
- // Copy short file (error after flushing)
- assert(lilv_copy_file(file_path, "/dev/full") == ENOSPC);
-
- // Copy long file (error during writing)
- f = fopen(file_path, "w");
- for (size_t i = 0; i < 4096; ++i) {
- fprintf(f, "test\n");
- }
- fclose(f);
- assert(lilv_copy_file(file_path, "/dev/full") == ENOSPC);
- }
-
- assert(!zix_remove(copy_path));
- assert(!zix_remove(file_path));
- assert(!zix_remove(temp_dir));
-
- free(copy_path);
- free(file_path);
- free(temp_dir);
-}
-
-static void
test_flock(void)
{
char* const temp_dir = lilv_create_temporary_directory("lilvXXXXXX");
@@ -275,7 +238,6 @@ main(void)
test_path_parent();
test_path_filename();
test_is_directory();
- test_copy_file();
test_flock();
test_dir_for_each();
diff --git a/test/test_util.c b/test/test_util.c
index f6f7feb..2e5b2fb 100644
--- a/test/test_util.c
+++ b/test/test_util.c
@@ -27,10 +27,6 @@ main(void)
fclose(fb);
fclose(fa);
- assert(lilv_copy_file("does/not/exist", "copy"));
- assert(lilv_copy_file(a_path, "not/a/dir/copy"));
- assert(!lilv_copy_file(a_path, "copy_c"));
-
assert(!zix_remove(a_path));
assert(!zix_remove(b_path));
assert(!zix_remove(dir));