X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/0959b6d4289bd106fddb7fe7d84a346159895fdd..484799563310e57a6cac8693ce18f6db71c1b80d:/unit-tests/test-cases/NSAddImage-leafname/main.c?ds=sidebyside diff --git a/unit-tests/test-cases/NSAddImage-leafname/main.c b/unit-tests/test-cases/NSAddImage-leafname/main.c index 28922af..f1ad630 100644 --- a/unit-tests/test-cases/NSAddImage-leafname/main.c +++ b/unit-tests/test-cases/NSAddImage-leafname/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2005-2009 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -23,6 +23,7 @@ #include #include #include +#include #include "test.h" @@ -30,11 +31,14 @@ int main() { +// NSAddImage is only available on Mac OS X - not iPhone OS +#if __MAC_OS_X_VERSION_MIN_REQUIRED // test that NSAddImage() uses fallback path when given a leaf name const struct mach_header * mh = NSAddImage("libzzz.dylib", NSADDIMAGE_OPTION_WITH_SEARCHING); - if ( mh != NULL ) - PASS("NSAddImage-leafname"); - else + if ( mh == NULL ) FAIL("NSAddImage-leafname"); + else +#endif + PASS("NSAddImage-leafname"); return EXIT_SUCCESS; }