]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_need_closure.dtest/main.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / dyld_need_closure.dtest / main.c
1
2 // BUILD: $CC main.c -o $BUILD_DIR/foo.exe
3 // BUILD: $CC main.c -o $BUILD_DIR/dyld_need_closure.exe
4
5 // RUN: ./dyld_need_closure.exe
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <mach-o/dyld_priv.h>
10
11 #include "test_support.h"
12
13 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
14 // We only support trying to save to containerised paths, so anything not
15 // of that form should fail
16
17 // FIXME: dyld_need_closure() needs an existing directory structure, so we can't run this in BATS
18 // if ( !dyld_need_closure("./foo.exe", "/private/var/mobile/Containers/Data/Application") ) {
19 // FAIL("Should have needed a closure for containerised path");
20 // }
21
22 if ( dyld_need_closure("./foo.exe", "/private/var/mobile/Other/Stuff") ) {
23 FAIL("Should have rejected a closure for non-containerised path");
24 }
25
26 PASS("Success");
27 }