]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/_dyld_shared_cache_contains_path.dtest/main.c
2 // BUILD: $CC main.c -o $BUILD_DIR/_dyld_shared_cache_contains_path.exe
4 // RUN: ./_dyld_shared_cache_contains_path.exe
9 #include <mach-o/dyld_priv.h>
12 #include "test_support.h"
14 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[])
17 bool hasCache
= ( _dyld_get_shared_cache_range(&length
) != NULL
);
19 if ( _dyld_shared_cache_contains_path("/usr/lib/libSystem.B.dylib") != hasCache
) {
21 FAIL("libSystem.B.dylib is not in dyld cache");
23 FAIL("no cache, but libSystem.B.dylib is in dyld cache");
26 if ( _dyld_shared_cache_contains_path("/System/Library/Frameworks/Foundation.framework/Foundation") != hasCache
) {
28 FAIL("Foundation.framework is not in dyld cache");
30 FAIL("no cache, but Foundation.framework is in dyld cache");
34 if ( _dyld_shared_cache_contains_path("/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation") != hasCache
) {
36 FAIL("Current/Foundation.framework is not in dyld cache");
38 FAIL("no cache, but Current/Foundation.framework is in dyld cache");