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) {
extract_flags |= WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES;
extract_flags |= WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS;
add_flags |= WIMLIB_ADD_FLAG_NTFS;
- cmp_flags |= WIMLIB_CMP_FLAG_COMPRESSION_NOT_PRESERVED;
+ cmp_flags |= WIMLIB_CMP_FLAG_NTFS_3G_MODE;
create_ntfs_volume(TMP_TARGET_NAME);
} else
#endif
{
#ifdef __WIN32__
printf("applying in Windows mode\n");
+ cmp_flags |= WIMLIB_CMP_FLAG_WINDOWS_MODE;
#else /* __WIN32__ */
printf("applying in UNIX mode\n");
- cmp_flags |= WIMLIB_CMP_FLAG_SHORT_NAMES_NOT_PRESERVED;
- cmp_flags |= WIMLIB_CMP_FLAG_ATTRIBUTES_NOT_PRESERVED;
- cmp_flags |= WIMLIB_CMP_FLAG_SECURITY_NOT_PRESERVED;
- cmp_flags |= WIMLIB_CMP_FLAG_ADS_NOT_PRESERVED;
- cmp_flags |= WIMLIB_CMP_FLAG_IMAGE2_SHOULD_HAVE_SYMLINKS;
+ extract_flags |= WIMLIB_EXTRACT_FLAG_UNIX_DATA;
+ add_flags |= WIMLIB_ADD_FLAG_UNIX_DATA;
+ cmp_flags |= WIMLIB_CMP_FLAG_UNIX_MODE;
#endif /* !__WIN32__ */
}
add_flags |= WIMLIB_ADD_FLAG_NORPFIX;
printf("comparing wimboot.wim:%d with wim%d:%d\n",
image, index2, image_count + 1);
- CHECK_RET(wimlib_compare_images(wim, image, wim2, image_count + 1, 0));
+ CHECK_RET(wimlib_compare_images(wim, image, wim2, image_count + 1,
+ WIMLIB_CMP_FLAG_WINDOWS_MODE));
wimlib_free(wim);
wimlib_free(wim2);