]> wimlib.net Git - wimlib/blobdiff - tests/multi-mount/multi-mount.c
Add multi-mount program
[wimlib] / tests / multi-mount / multi-mount.c
diff --git a/tests/multi-mount/multi-mount.c b/tests/multi-mount/multi-mount.c
new file mode 100644 (file)
index 0000000..8b93286
--- /dev/null
@@ -0,0 +1,31 @@
+#include <wimlib.h>
+#include <assert.h>
+#include <omp.h>
+
+int main(int argc, char **argv)
+{
+       int ret;
+       WIMStruct *w1;
+       WIMStruct *w2;
+
+       assert(argc == 5);
+       ret = wimlib_open_wim(argv[1], 0, &w1);
+       assert(ret == 0);
+
+       ret = wimlib_open_wim(argv[2], 0, &w2);
+       assert(ret == 0);
+
+       #pragma omp parallel num_threads(2)
+       {
+               int ret;
+               assert(omp_get_num_threads() == 2);
+               if (omp_get_thread_num() == 0)
+                       ret = wimlib_mount(w1, 1, argv[3],
+                                          WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0);
+               else
+                       ret = wimlib_mount(w2, 1, argv[4],
+                                          WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0);
+               assert(ret == 0);
+       }
+       return 0;
+}