Lines 25-47
Link Here
|
25 |
TEST("create", encfs_stash_new(crypt_dir, mount_dir, PASSWORD1)); |
25 |
TEST("create", encfs_stash_new(crypt_dir, mount_dir, PASSWORD1)); |
26 |
sleep(1); |
26 |
sleep(1); |
27 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
27 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
28 |
TEST("mount", encfs_stash_mount(crypt_dir, mount_dir, PASSWORD1, 0, &output)); |
28 |
TEST("mount", encfs_stash_mount(crypt_dir, mount_dir, PASSWORD1, 0, false, &output)); |
29 |
OUTPUT(); |
29 |
OUTPUT(); |
30 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
30 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
31 |
|
31 |
|
32 |
TEST("change password", encfs_stash_change_password(crypt_dir, PASSWORD1, PASSWORD2, &output)); |
32 |
TEST("change password", encfs_stash_change_password(crypt_dir, PASSWORD1, PASSWORD2, &output)); |
33 |
OUTPUT(); |
33 |
OUTPUT(); |
34 |
|
34 |
|
35 |
TEST("mount", encfs_stash_mount(crypt_dir, mount_dir, PASSWORD2, 0, &output)); |
35 |
TEST("mount", encfs_stash_mount(crypt_dir, mount_dir, PASSWORD2, 0, false, &output)); |
36 |
OUTPUT(); |
36 |
OUTPUT(); |
37 |
sleep(1); |
37 |
sleep(1); |
38 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
38 |
TEST("unmount", encfs_stash_unmount(mount_dir)); |
39 |
|
39 |
|
40 |
TEST("incorrect password mount", !encfs_stash_mount(crypt_dir, mount_dir, "blah", 0, &output)); |
40 |
TEST("incorrect password mount", !encfs_stash_mount(crypt_dir, mount_dir, "blah", 0, false, &output)); |
41 |
OUTPUT(); |
41 |
OUTPUT(); |
42 |
|
42 |
|
43 |
system("touch unit_test_mount/file"); |
43 |
system("touch unit_test_mount/file"); |
44 |
TEST("non-empty mount point mount", !encfs_stash_mount(crypt_dir, mount_dir, PASSWORD2, 0, &output)); |
44 |
TEST("non-empty mount point mount", !encfs_stash_mount(crypt_dir, mount_dir, PASSWORD2, 0, false, &output)); |
45 |
OUTPUT(); |
45 |
OUTPUT(); |
46 |
|
46 |
|
47 |
TEST("get_info", encfs_stash_get_info(crypt_dir, &output)); |
47 |
TEST("get_info", encfs_stash_get_info(crypt_dir, &output)); |
Lines 51-54
Link Here
|
51 |
system("rm -rf unit_test_crypt unit_test_mount"); |
51 |
system("rm -rf unit_test_crypt unit_test_mount"); |
52 |
|
52 |
|
53 |
printf("%d tests passed, %d tests failed\n", passed, failed); |
53 |
printf("%d tests passed, %d tests failed\n", passed, failed); |
|
|
54 |
|
55 |
if (failed > 0) { |
56 |
return 1; |
57 |
} |
54 |
} |
58 |
} |