X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=tests%2Fwin32-tree-cmp.c;fp=tests%2Fwin32-tree-cmp.c;h=1b6a0276e9025e88e715f917398c3f5866a39968;hb=d618301958672979dac9df68535619efb3997d7c;hp=9a0d8117df0ed7d6978e13619101ac4b9ec72f21;hpb=3bbe0bf2d7235584e1df11f21043338b18a5753e;p=wimlib diff --git a/tests/win32-tree-cmp.c b/tests/win32-tree-cmp.c index 9a0d8117..1b6a0276 100644 --- a/tests/win32-tree-cmp.c +++ b/tests/win32-tree-cmp.c @@ -612,12 +612,15 @@ tree_cmp(wchar_t *path_1, size_t path_1_len, wchar_t *path_2, size_t path_2_len) common_attribs = file_info_1.dwFileAttributes & file_info_2.dwFileAttributes; - /* Compare file sizes. */ - size_1 = ((u64)file_info_1.nFileSizeHigh << 32) | file_info_1.nFileSizeLow; - size_2 = ((u64)file_info_2.nFileSizeHigh << 32) | file_info_2.nFileSizeLow; - if (size_1 != size_2) - difference(L"Size for %ls (%"PRIu64") differs from size for %ls (%"PRIu64")", - path_1, size_1, path_2, size_2); + /* Compare file sizes, unless the files are both directories in which + * cases the sizes can legitimately differ. */ + if (!(common_attribs & FILE_ATTRIBUTE_DIRECTORY)) { + size_1 = ((u64)file_info_1.nFileSizeHigh << 32) | file_info_1.nFileSizeLow; + size_2 = ((u64)file_info_2.nFileSizeHigh << 32) | file_info_2.nFileSizeLow; + if (size_1 != size_2) + difference(L"Size for %ls (%"PRIu64") differs from size for %ls (%"PRIu64")", + path_1, size_1, path_2, size_2); + } /* Compare file times. */ if (!file_times_equal(&file_info_1.ftCreationTime, &file_info_2.ftCreationTime))