X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/bac542e65c0030c0d819c7ff1dcfc25892a61844..19894a1236eae932b4028640f24ab843f691d4e4:/unit-tests/test-cases/bundle-memory-load-bad/main.c diff --git a/unit-tests/test-cases/bundle-memory-load-bad/main.c b/unit-tests/test-cases/bundle-memory-load-bad/main.c index fe100da..7e8c93c 100644 --- a/unit-tests/test-cases/bundle-memory-load-bad/main.c +++ b/unit-tests/test-cases/bundle-memory-load-bad/main.c @@ -28,11 +28,14 @@ #include #include #include +#include #include "test.h" // PASS(), FAIL() int main() { +// NSAddImage is only available on Mac OS X - not iPhone OS +#if __MAC_OS_X_VERSION_MIN_REQUIRED int fd = open("test.bundle", O_RDONLY, 0); if ( fd == -1 ) { FAIL("open() failed"); @@ -55,10 +58,11 @@ int main() // we are using a file not of type MH_BUNDLE, so NSCreateObjectFileImageFromMemory should fail NSObjectFileImage ofi; - if ( NSCreateObjectFileImageFromMemory(loadAddress, stat_buf.st_size, &ofi) != NSObjectFileImageSuccess ) - PASS("bundle-memory-load-bad"); - else + if ( NSCreateObjectFileImageFromMemory(loadAddress, stat_buf.st_size, &ofi) == NSObjectFileImageSuccess ) FAIL("bundle-memory-load-bad"); + else +#endif + PASS("bundle-memory-load-bad"); return 0; } \ No newline at end of file