]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-jna.dtest/foo.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-jna.dtest / foo.c
1
2 #include <stdio.h>
3 #include <dlfcn.h>
4 #include <mach-o/dyld.h>
5
6 #include "test_support.h"
7
8 void foo() {
9 // foo can't see libFoundation.dylib as it's name isn't correct
10 void* handle = dlopen("libFoundation.dylib", RTLD_LAZY);
11 if ( handle != NULL ) {
12 FAIL("dlopen-jna, libfoo should not be able to dlopen()");
13 }
14
15 // foo can't see libSecurity.dylib as it's name isn't correct
16 void* handle2 = dlopen("libSecurity.dylib", RTLD_LAZY);
17 if ( handle2 != NULL ) {
18 FAIL("dlopen-jna, libfoo should not be able to dlopen()");
19 }
20
21 // foo can't see libCarbon.dylib as it's name isn't correct
22 void* handle3 = dlopen("libCarbon.dylib", RTLD_LAZY);
23 if ( handle3 != NULL ) {
24 FAIL("dlopen-jna, libfoo should not be able to dlopen()");
25 }
26 }