]> git.saurik.com Git - apple/xnu.git/blobdiff - tests/xnu_quick_test_entitled.c
xnu-4903.270.47.tar.gz
[apple/xnu.git] / tests / xnu_quick_test_entitled.c
index ec1252fb4a34c9fc28b4ea63281f0be6dd118514..b3d6a9d4b3590be9c4c50a16d4040b39c48b435e 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/csr.h>
 #endif
 
-T_GLOBAL_META (T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false));
+T_GLOBAL_META(T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false));
 
 
 /*  **************************************************************************************************************
@@ -21,15 +21,15 @@ T_GLOBAL_META (T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false));
  *  **************************************************************************************************************
  */
 T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCGETBLOCKSIZE",
-       T_META_ASROOT(true))
+    T_META_ASROOT(true))
 {
-       int                                     my_err;
-       int                                     my_fd = -1;
-       struct statfs *         my_infop;
-       char *                          my_ptr;
-       int                                     my_blksize;
-       long long                       my_block_count;
-       char                            my_name[ MAXPATHLEN ];
+       int                                     my_err;
+       int                                     my_fd = -1;
+       struct statfs *         my_infop;
+       char *                          my_ptr;
+       int                                     my_blksize;
+       long long                       my_block_count;
+       char                            my_name[MAXPATHLEN];
 
 #if !TARGET_OS_EMBEDDED
        /*
@@ -37,7 +37,7 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG
         * disabled or in AppleInternal mode
         */
        if (csr_check( CSR_ALLOW_UNRESTRICTED_FS ) &&
-               csr_check( CSR_ALLOW_APPLE_INTERNAL ) ) {
+           csr_check( CSR_ALLOW_APPLE_INTERNAL )) {
                T_SKIP("System Integrity Protection is enabled");
        }
 #endif
@@ -48,11 +48,11 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG
        T_ASSERT_GT(getmntinfo( &my_infop, MNT_NOWAIT ), 0, "getmntinfo");
 
        /* make this a raw device */
-       strlcpy( &my_name[0], &my_infop->f_mntfromname[0], sizeof(my_name) );
-       if ( (my_ptr = strrchr( &my_name[0], '/' )) != 0 ) {
-               if ( my_ptr[1] != 'r' ) {
-                       my_ptr[ strlen( my_ptr ) ] = 0x00;
-                       memmove( &my_ptr[2], &my_ptr[1], (strlen( &my_ptr[1] ) + 1) );
+       strlcpy( &my_name[0], &my_infop->f_mntfromname[0], sizeof(my_name));
+       if ((my_ptr = strrchr( &my_name[0], '/' )) != 0) {
+               if (my_ptr[1] != 'r') {
+                       my_ptr[strlen( my_ptr )] = 0x00;
+                       memmove( &my_ptr[2], &my_ptr[1], (strlen( &my_ptr[1] ) + 1));
                        my_ptr[1] = 'r';
                }
        }
@@ -63,11 +63,11 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG
 
        /* obtain the size of the media (in blocks) */
        T_EXPECT_POSIX_SUCCESS(my_err = ioctl( my_fd, DKIOCGETBLOCKCOUNT, &my_block_count ),
-                                                  "ioctl DKIOCGETBLOCKCOUNT");
+           "ioctl DKIOCGETBLOCKCOUNT");
 
        /* obtain the block size of the media */
        T_EXPECT_POSIX_SUCCESS(my_err = ioctl( my_fd, DKIOCGETBLOCKSIZE, &my_blksize ),
-                                                  "ioctl DKIOCGETBLOCKSIZE");
+           "ioctl DKIOCGETBLOCKSIZE");
 
        T_LOG( "my_block_count %qd my_blksize %d \n", my_block_count, my_blksize );