Bug 453164 - 'TestServMgr' : "mFreeCount : LEAKED 233 + mAdoptFreeCount : LEAKED 7"; r=benjamin
authorSerge Gautherie <sgautherie.bz@free.fr>
Wed, 08 Oct 2008 02:22:01 +0200
changeset 20119 bfb00692bddcf733c89889f9003c7aeee562690d
parent 20118 4c7ccb9f3e70e57dc8b9c122c55ca46ffd378ca5
child 20120 08d40042160e620b0ced25eaaa392985cee644ce
push idunknown
push userunknown
push dateunknown
reviewersbenjamin
bugs453164
milestone1.9.1b2pre
Bug 453164 - 'TestServMgr' : "mFreeCount : LEAKED 233 + mAdoptFreeCount : LEAKED 7"; r=benjamin
xpcom/tests/TestServMgr.cpp
--- a/xpcom/tests/TestServMgr.cpp
+++ b/xpcom/tests/TestServMgr.cpp
@@ -140,36 +140,49 @@ AsyncNoShutdownTest(int testNumber)
 
     return err;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int
 main(void)
 {
-    nsresult err;
+    nsresult err, rv = 0;
     int testNumber = 0;
 
     err = NS_InitXPCOM2(nsnull, nsnull, nsnull);
     if (NS_FAILED(err)) {
         printf("NS_InitXPCOM2 failed\n");
         return -1;
     }
 
     err = SimpleTest(++testNumber);
-    if (err != NS_OK)
-        goto error;
+    if (err != NS_OK) {
+        printf("test %d failed\n", testNumber);
+        rv = -1;
+    }
 
-    err = AsyncNoShutdownTest(++testNumber);
-    if (err != NS_OK)
-        goto error;
+    if (rv == 0) {
+        err = AsyncNoShutdownTest(++testNumber);
+        if (err != NS_OK) {
+            printf("test %d failed\n", testNumber);
+            rv = -1;
+        }
+    }
 
-    AsyncShutdown(++testNumber);
+    if (rv == 0) {
+        err = AsyncShutdown(++testNumber);
+        if (err != NS_OK) {
+            printf("test %d failed\n", testNumber);
+            rv = -1;
+        }
+    }
 
-    printf("there was great success\n");
-    return 0;
+    if (rv == 0)
+        printf("there was great success\n");
 
-  error:
-    printf("test %d failed\n", testNumber);
-    return -1;
+    err = NS_ShutdownXPCOM(nsnull);
+    NS_ASSERTION(NS_SUCCEEDED(err), "NS_ShutdownXPCOM failed");
+
+    return rv;
 }
 
 ////////////////////////////////////////////////////////////////////////////////