]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-long-error-message.dtest/main.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-long-error-message.dtest / main.c
1
2 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-long-error-message.exe
3
4 // RUN: ./dlopen-long-error-message.exe
5
6 #include <stdio.h>
7 #include <dlfcn.h>
8 #include <string.h>
9 #include <stdlib.h>
10
11 #include "test_support.h"
12
13 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
14 for (int i=0; i < 10; ++i) {
15 void* handle = dlopen("/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/bogus/path/libbogus.dylib", RTLD_FIRST);
16 if ( handle != NULL ) {
17 FAIL("Should have failed on non-existent file");
18 return 0;
19 }
20 free(strdup("hello there"));
21 }
22
23 PASS("Success");
24 }
25