X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/0959b6d4289bd106fddb7fe7d84a346159895fdd..19894a1236eae932b4028640f24ab843f691d4e4:/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c diff --git a/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c b/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c index 9442bf1..bcb2bea 100644 --- a/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/main.c +++ b/unit-tests/test-cases/NSAddImage-MATCH_BY_INSTALLNAME/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,19 +23,23 @@ #include #include #include - +#include + #include "test.h" /// rdar://problem/4058724 int main() { +// NSAddImage is only available on Mac OS X - not iPhone OS +#if __MAC_OS_X_VERSION_MIN_REQUIRED // test that image can be found via install path const struct mach_header * mh1 = NSAddImage("libbar.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR | NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME); const struct mach_header * mh2 = NSAddImage("libfoo.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR | NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME); - if ( mh2 != NULL ) - PASS("NSAddImage-MATCH_BY_INSTALLNAME"); - else + if ( mh2 == NULL ) FAIL("NSAddImage-MATCH_BY_INSTALLNAME"); + else +#endif + PASS("NSAddImage-MATCH_BY_INSTALLNAME"); return EXIT_SUCCESS; }