]> Zhao Yanbai Git Server - minix.git/commitdiff
test65: simply skip if ntfs binaries are not present
authorThomas Veerman <thomas@minix3.org>
Tue, 27 Nov 2012 10:19:26 +0000 (10:19 +0000)
committerThomas Veerman <thomas@minix3.org>
Tue, 27 Nov 2012 10:19:26 +0000 (10:19 +0000)
test/test65.c

index ca9e70bd49c714cda46a216bb754f719e4d363ff..27347e93c0641a8e85b1318aec736f1a7ac23e73 100644 (file)
@@ -18,6 +18,7 @@
 
 void basic_test(void);
 void bomb(char const *msg);
+void skip(char const *msg);
 void create_partition(void);
 void verify_tools(void);
 
@@ -56,6 +57,14 @@ basic_test(void)
        if (strncmp(file_buf, TESTSTRING, strlen(TESTSTRING))) e(3);
 }
 
+void
+skip(char const *msg)
+{
+       system("umount " RAMDISK SILENT);
+       printf("%s\n", msg);
+       quit();
+}
+
 void
 bomb(char const *msg)
 {
@@ -100,12 +109,12 @@ verify_tools(void)
        subtest = 1;
        status = system("which mkntfs > /dev/null 2>&1");
        if (WEXITSTATUS(status) != 0) {
-               bomb("mkntfs not found. Please install ntfsprogs (pkgin in "
+               skip("mkntfs not found. Please install ntfsprogs (pkgin in "
                        "ntfsprogs)");
        }
        status = system("which ntfs-3g > /dev/null 2>&1");
        if (WEXITSTATUS(status) != 0) {
-               bomb("ntfs-3g not found. Please install fuse-ntfs-3g-1.1120 "
+               skip("ntfs-3g not found. Please install fuse-ntfs-3g-1.1120 "
                        "(pkgin in fuse-ntfs-3g-1.1120)");
        }
 }