]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/loader_path/main.c
dyld-353.2.1.tar.gz
[apple/dyld.git] / unit-tests / test-cases / loader_path / main.c
index 141931fe13f4c4d8ef66bc03eb6629dd4c48cf1a..f8600b477bbb64fa58ecb5b430b360fb9cad4eb8 100644 (file)
@@ -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@
  * 
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
 #include <stdio.h>
 #include <stdlib.h>
 #include <mach-o/dyld.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <mach-o/dyld.h>
+#include <Availability.h>
+#include <dlfcn.h>
 
 #include "test.h"
 
 
 int main()
 {
 
 #include "test.h"
 
 
 int main()
 {
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5)
        NSAddImage("@loader_path/hide/libfoo3.dylib", 0);
        NSAddImage("@loader_path/hide/libfoo3.dylib", 0);
-
-       PASS("loader_path");
+#else
+       if ( dlopen("@loader_path/hide/libfoo3.dylib", 0) == NULL )
+               FAIL("loader_path");
+       else
+#endif
+               PASS("loader_path");
        return EXIT_SUCCESS;
 }
        return EXIT_SUCCESS;
 }