diff options
author | David Robillard <d@drobilla.net> | 2022-11-12 17:54:15 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-16 10:22:55 -0500 |
commit | ab98128551cc97e333caf714830f807bbe25bae7 (patch) | |
tree | c63f14badd247071bbe54971ef7d75e5b81bd18d /test/test_filesystem.c | |
parent | dd5e8510cb40b853a5d252084660dc38aab7c665 (diff) | |
download | lilv-ab98128551cc97e333caf714830f807bbe25bae7.tar.gz lilv-ab98128551cc97e333caf714830f807bbe25bae7.tar.bz2 lilv-ab98128551cc97e333caf714830f807bbe25bae7.zip |
Use zix_file_equals()
Diffstat (limited to 'test/test_filesystem.c')
-rw-r--r-- | test/test_filesystem.c | 34 |
1 files changed, 1 insertions, 33 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; } |