X-Git-Url: https://git.saurik.com/apple/hfs.git/blobdiff_plain/558d2836cb4329cfdb20acd2c5c4cd1945ad0a66..0af7c7673fb2c9da95a48e7e8092324dc441ed24:/tests/cases/test-set-protection-class.c diff --git a/tests/cases/test-set-protection-class.c b/tests/cases/test-set-protection-class.c index 164de50..55751f3 100644 --- a/tests/cases/test-set-protection-class.c +++ b/tests/cases/test-set-protection-class.c @@ -27,7 +27,7 @@ int run_set_protection_class(__unused test_ctx_t *ctx) { const char *tstdir; -#if TARGET_OS_EMBEDDED +#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) // The root file system needs to be HFS struct statfs sfs; @@ -38,7 +38,7 @@ int run_set_protection_class(__unused test_ctx_t *ctx) } tstdir = "/tmp"; -#else // !TARGET_OS_EMBEDDED +#else // !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) disk_image_t *di = disk_image_get(); tstdir = di->mount_point; #endif @@ -139,7 +139,7 @@ int run_set_protection_class(__unused test_ctx_t *ctx) assert_with_errno((fd = open(path, O_RDWR)) >= 0); -#if TARGET_OS_EMBEDDED +#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) assert_no_err(fcntl(fd, F_SETPROTECTIONCLASS, 2)); #endif @@ -158,9 +158,13 @@ int run_set_protection_class(__unused test_ctx_t *ctx) assert_no_err(close(fd)); if (fd2 != -1) assert_no_err(close(fd2)); + + assert_no_err(munmap(p, size)); } unlink(path); + free(buf); + free(buf2); return 0; }