X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/0959b6d4289bd106fddb7fe7d84a346159895fdd..19894a1236eae932b4028640f24ab843f691d4e4:/unit-tests/test-cases/bundle-multi-link/main.c?ds=sidebyside diff --git a/unit-tests/test-cases/bundle-multi-link/main.c b/unit-tests/test-cases/bundle-multi-link/main.c index 267d540..c15bd03 100644 --- a/unit-tests/test-cases/bundle-multi-link/main.c +++ b/unit-tests/test-cases/bundle-multi-link/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@ * @@ -22,6 +22,7 @@ */ #include #include +#include #include "test.h" // PASS(), FAIL() @@ -37,6 +38,8 @@ typedef int (*getter)(void); int main() { +// NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS +#if __MAC_OS_X_VERSION_MIN_REQUIRED NSObjectFileImage ofi; if ( NSCreateObjectFileImageFromFile("test.bundle", &ofi) != NSObjectFileImageSuccess ) { FAIL("NSCreateObjectFileImageFromFile failed"); @@ -62,7 +65,9 @@ int main() NSModule mod2 = NSLinkModule(ofi, "test2.bundle", NSLINKMODULE_OPTION_NONE); if ( mod2 == NULL ) { - FAIL("2nd NSLookupSymbolInModule failed"); + NSLinkEditErrors c; int errorNumber; const char* fileName; const char* errorString; + NSLinkEditError(&c, &errorNumber, &fileName, &errorString); + FAIL("2nd NSLinkModule failed: %s", errorString); return 0; } if ( mod == mod2 ) { @@ -150,9 +155,9 @@ int main() } // check that this is really a new copy by verifying the getValue() returns zero - NSSymbol sym4getter = NSLookupSymbolInModule(mod2, "_getValue"); + NSSymbol sym4getter = NSLookupSymbolInModule(mod4, "_getValue"); if ( sym4getter == NULL ) { - FAIL("2nd NSLookupSymbolInModule failed"); + FAIL("4th NSLookupSymbolInModule failed"); return 0; } getter func4getter = NSAddressOfSymbol(sym4getter); @@ -171,7 +176,8 @@ int main() FAIL("NSDestroyObjectFileImage failed"); return 0; } - +#endif + PASS("bundle-multi-link"); return 0; }