X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/2028a9150e06923c02d26423650de665cf4470dc..df9d6cf7fb01f4e3d4128fe7a687984fe0b45584:/unit-tests/test-cases/dlopen-leak/main.c diff --git a/unit-tests/test-cases/dlopen-leak/main.c b/unit-tests/test-cases/dlopen-leak/main.c index 511a140..3ff66e5 100644 --- a/unit-tests/test-cases/dlopen-leak/main.c +++ b/unit-tests/test-cases/dlopen-leak/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007 Apple Inc. All rights reserved. + * Copyright (c) 2007-2013 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -39,10 +39,15 @@ int main() dlopen("libnotthere.dylib", RTLD_LAZY); } + // execute leaks command on myself char cmd[512]; - sprintf(cmd, "leaks %u\n", getpid()); - system(cmd); - + sprintf(cmd, "sudo leaks %u > /dev/null\n", getpid()); + int result = system(cmd); + if ( result == EXIT_SUCCESS ) + PASS("dlopen-leak"); + else + FAIL("dlopen-leak"); + return EXIT_SUCCESS; }