summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-12 17:54:15 -0500
committerDavid Robillard <d@drobilla.net>2022-11-16 10:22:55 -0500
commitab98128551cc97e333caf714830f807bbe25bae7 (patch)
treec63f14badd247071bbe54971ef7d75e5b81bd18d /test
parentdd5e8510cb40b853a5d252084660dc38aab7c665 (diff)
downloadlilv-ab98128551cc97e333caf714830f807bbe25bae7.tar.gz
lilv-ab98128551cc97e333caf714830f807bbe25bae7.tar.bz2
lilv-ab98128551cc97e333caf714830f807bbe25bae7.zip
Use zix_file_equals()
Diffstat (limited to 'test')
-rw-r--r--test/test_filesystem.c34
-rw-r--r--test/test_state.c4
-rw-r--r--test/test_util.c6
3 files changed, 3 insertions, 41 deletions
diff --git a/test/test_filesystem.c b/test/test_filesystem.c
index 0e199c7..2057101 100644
--- a/test/test_filesystem.c
+++ b/test/test_filesystem.c
@@ -178,7 +178,7 @@ test_copy_file(void)
fclose(f);
assert(!lilv_copy_file(file_path, copy_path));
- assert(lilv_file_equals(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)
@@ -325,37 +325,6 @@ test_create_directories(void)
free(temp_dir);
}
-static void
-test_file_equals(void)
-{
- char* const temp_dir = lilv_create_temporary_directory("lilvXXXXXX");
- char* const path1 = zix_path_join(NULL, temp_dir, "lilv_test_1");
- char* const path2 = zix_path_join(NULL, temp_dir, "lilv_test_2");
-
- FILE* const f1 = fopen(path1, "w");
- FILE* const f2 = fopen(path2, "w");
- fprintf(f1, "test\n");
- fprintf(f2, "test\n");
-
- assert(lilv_file_equals(path1, path2));
-
- fprintf(f2, "diff\n");
- fflush(f2);
-
- assert(!lilv_file_equals(path1, path2));
-
- fclose(f2);
- fclose(f1);
-
- assert(!lilv_remove(path2));
- assert(!lilv_remove(path1));
- assert(!lilv_remove(temp_dir));
-
- free(path2);
- free(path1);
- free(temp_dir);
-}
-
int
main(void)
{
@@ -372,7 +341,6 @@ main(void)
test_dir_for_each();
test_create_temporary_directory();
test_create_directories();
- test_file_equals();
return 0;
}
diff --git a/test/test_state.c b/test/test_state.c
index 78a4e5d..e80ec89 100644
--- a/test/test_state.c
+++ b/test/test_state.c
@@ -627,7 +627,7 @@ test_to_files(void)
#endif
// Check that link points to the corresponding copy
- assert(lilv_file_equals(recfile_link_1, recfile_copy_1));
+ assert(zix_file_equals(NULL, recfile_link_1, recfile_copy_1));
// Run plugin again to modify recording file data
lilv_instance_run(instance, 2);
@@ -658,7 +658,7 @@ test_to_files(void)
#endif
// Check that link points to the corresponding copy
- assert(lilv_file_equals(recfile_link_2, recfile_copy_2));
+ assert(zix_file_equals(NULL, recfile_link_2, recfile_copy_2));
lilv_instance_free(instance);
lilv_dir_for_each(bundle_2_path, NULL, remove_file);
diff --git a/test/test_util.c b/test/test_util.c
index 94e5567..529719e 100644
--- a/test/test_util.c
+++ b/test/test_util.c
@@ -28,12 +28,6 @@ main(void)
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(!lilv_file_equals(a_path, b_path));
- assert(lilv_file_equals(a_path, a_path));
- assert(lilv_file_equals(a_path, "copy_c"));
- assert(!lilv_file_equals("does/not/exist", b_path));
- assert(!lilv_file_equals(a_path, "does/not/exist"));
- assert(!lilv_file_equals("does/not/exist", "/does/not/either"));
assert(!lilv_remove(a_path));
assert(!lilv_remove(b_path));