]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-jna.dtest/jna.c
dyld-832.7.1.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-jna.dtest / jna.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 jna() {
9 // jna should see libFoundation.dylib as it's name is correct
10 void* handle = dlopen("libFoundation.dylib", RTLD_LAZY);
11 if ( handle == NULL ) {
12 FAIL("dlopen-jna, libjna not be able to dlopen(): %s", dlerror());
13 }
14
15 // jna should see libSecurity.dylib as it's name is correct
16 void* handle2 = dlopen("libSecurity.dylib", RTLD_LAZY);
17 if ( handle2 == NULL ) {
18 FAIL("dlopen-jna, libjna not be able to dlopen(): %s", dlerror());
19 }
20
21 // jna should see libCarbon.dylib as it's name is correct
22 void* handle2 = dlopen("libCarbon.dylib", RTLD_LAZY);
23 if ( handle2 == NULL ) {
24 FAIL("dlopen-jna, libjna not be able to dlopen(): %s", dlerror());
25 }
26 }