]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-signing.dtest/main.c
1 // BUILD: $CC dylib.c -dynamiclib -o $BUILD_DIR/signed.dylib
2 // BUILD: $CC dylib.c -dynamiclib -o $BUILD_DIR/unsigned.dylib
3 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-signed.exe
4 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-unsigned.exe
6 // FIXME: add builds that sign the executable and the dylib in in various ways
7 // At this time we don't have a way to do that, so this test must be run
13 #include "test_support.h"
15 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
16 void* handle
= dlopen("signed.dylib", RTLD_LAZY
);
17 if ( handle
== NULL
) {
18 FAIL("dlerror(): %s", dlerror());
20 int result
= dlclose(handle
);
22 FAIL("dlclose() returned %c", result
);
26 handle
= dlopen("unsigned.dylib", RTLD_LAZY
);
27 if ( handle
!= NULL
) {
28 FAIL("dlerror(): %s", dlerror());
30 int result
= dlclose(handle
);
32 FAIL("dlclose() returned %c", result
);