X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/39a8cd101b922f08058746122efff58c14b57605..797cc9518557438c2166863f4e1804db04ecfa2d:/unit-tests/test-cases/interpose-shared-cache/main.c diff --git a/unit-tests/test-cases/interpose-shared-cache/main.c b/unit-tests/test-cases/interpose-shared-cache/main.c index 192b3b6..93ef898 100644 --- a/unit-tests/test-cases/interpose-shared-cache/main.c +++ b/unit-tests/test-cases/interpose-shared-cache/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2008 Apple Inc. All rights reserved. + * Copyright (c) 2005-2011 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -24,15 +24,20 @@ #include // exit(), EXIT_SUCCESS #include #include +#include #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() +extern bool allocationSeen(void* p); +typedef bool (*seenProc)(void*); int main() { - const char* x = strdup("123"); - - if ( (strcmp(&x[-16], "hello") == 0) ) + void* x = strdup("123"); + + seenProc seen = (seenProc)dlsym(RTLD_DEFAULT, "allocationSeen"); + + if ( (seen != NULL) && (*seen)(x) ) PASS("interpose-basic-shared-cache"); else FAIL("interpose-basic-shared-cache");