]> wimlib.net Git - wimlib/blob - tests/multi-mount/multi-mount.c
Fix programs not compiled by default
[wimlib] / tests / multi-mount / multi-mount.c
1 #include <wimlib.h>
2 #include <assert.h>
3 #include <omp.h>
4
5 int main(int argc, char **argv)
6 {
7         int ret;
8         WIMStruct *w1;
9         WIMStruct *w2;
10
11         assert(argc == 5);
12         ret = wimlib_open_wim(argv[1], 0, &w1, NULL);
13         assert(ret == 0);
14
15         ret = wimlib_open_wim(argv[2], 0, &w2, NULL);
16         assert(ret == 0);
17
18         #pragma omp parallel num_threads(2)
19         {
20                 int ret;
21                 assert(omp_get_num_threads() == 2);
22                 if (omp_get_thread_num() == 0) {
23                         ret = wimlib_mount_image(w1, 1, argv[3],
24                                                  WIMLIB_MOUNT_FLAG_DEBUG, NULL);
25                 } else {
26                         ret = wimlib_mount_image(w2, 1, argv[4],
27                                                  WIMLIB_MOUNT_FLAG_DEBUG, NULL);
28                 }
29                 assert(ret == 0);
30         }
31         return 0;
32 }