]> wimlib.net Git - wimlib/blobdiff - tests/wlfuzz.c
Capture and apply extended attributes on Windows
[wimlib] / tests / wlfuzz.c
index 3db4630ebbc5170724841c5e6658d85c7c931be7..dc62d44d3b64ff688384c1b06e02df37c8a72cfa 100644 (file)
@@ -722,14 +722,29 @@ op__apply_and_capture_test(void)
        CHECK_RET(wimlib_add_image(wim, (void *)rand32, NULL, NULL,
                                   WIMLIB_ADD_FLAG_GENERATE_TEST_DATA |
                                   WIMLIB_ADD_FLAG_NORPFIX));
+
+       image = get_image_count(wim);
+
+       printf("generated wim%d image %d\n", index, image);
+
+       {
+               /*
+                * Compare the in-memory version of the generated image with a
+                * version written to disk
+                */
+               WIMStruct *tmp_wim;
+
+               CHECK_RET(wimlib_write(wim, T("tmp.wim"), image, 0, 0));
+               CHECK_RET(wimlib_open_wim(T("tmp.wim"), 0, &tmp_wim));
+               CHECK_RET(wimlib_compare_images(wim, image, tmp_wim, 1, 0));
+               wimlib_free(tmp_wim);
+       }
+
        overwrite_wim(wim);
        wimlib_free(wim);
 
        /* Apply the generated image.  */
        wim = open_wim(index);
-       image = get_image_count(wim);
-       printf("apply and capture wim%d; generated image is index %d\n",
-              index, image);
        delete_directory_tree(TMP_TARGET_NAME);
 #ifdef WITH_NTFS_3G
        if (rand32() & 1) {
@@ -749,6 +764,8 @@ op__apply_and_capture_test(void)
                cmp_flags |= WIMLIB_CMP_FLAG_WINDOWS_MODE;
 #else /* __WIN32__ */
                printf("applying in UNIX mode\n");
+               extract_flags |= WIMLIB_EXTRACT_FLAG_UNIX_DATA;
+               add_flags |= WIMLIB_ADD_FLAG_UNIX_DATA;
                cmp_flags |= WIMLIB_CMP_FLAG_UNIX_MODE;
 #endif /* !__WIN32__ */
        }
@@ -809,6 +826,7 @@ unregister_all_backing_wims(const tchar drive_letter)
                             overlay_list, 32768, &bytes_returned, NULL))
        {
                ASSERT(GetLastError() == ERROR_INVALID_FUNCTION ||
+                      GetLastError() == ERROR_INVALID_PARAMETER ||
                       GetLastError() == ERROR_FILE_NOT_FOUND,
                       "FSCTL_ENUM_OVERLAY failed; error=%u", GetLastError());
                return;