]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/dlopen-leak/main.c
dyld-360.14.tar.gz
[apple/dyld.git] / unit-tests / test-cases / dlopen-leak / main.c
index 511a1408322697c7f5fbdbaca0770f8e6f400b86..3ff66e51ef47a3761b1ff30d8a492b309d274c20 100644 (file)
@@ -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;
 }