registration-order-test-fixup
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 125 ed7d306bd129b107164a8121618c28e7a64d68d0
permissions -rw-r--r--
State as of now

diff --git a/xpcom/tests/TestHarness.h b/xpcom/tests/TestHarness.h
--- a/xpcom/tests/TestHarness.h
+++ b/xpcom/tests/TestHarness.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -81,9 +81,23 @@ void passed(const char* test)
 }
 
 
+class ScopedLogging
+{
+public:
+    ScopedLogging()
+    {
+        NS_LogInit();
+    }
+
+    ~ScopedLogging()
+    {
+        NS_LogTerm();
+    }
+};
+
 class ScopedXPCOM
 {
-  public:
+public:
     ScopedXPCOM(const char* testName,
                 nsIDirectoryServiceProvider *dirSvcProvider = NULL)
     {
@@ -119,7 +133,7 @@ class ScopedXPCOM
       return mServMgr == NULL;
     }
 
-  private:
+private:
     const char* mTestName;
     nsIServiceManager* mServMgr;
 };
diff --git a/xpcom/tests/TestRegistrationOrder.cpp b/xpcom/tests/TestRegistrationOrder.cpp
--- a/xpcom/tests/TestRegistrationOrder.cpp
+++ b/xpcom/tests/TestRegistrationOrder.cpp
@@ -249,6 +249,8 @@ int main(int argc, char** argv)
     return 1;
   }
 
+  ScopedLogging log;
+
   const char *regPath = argv[1];
   RegOrderDirSvcProvider *dirSvcProvider = new RegOrderDirSvcProvider(regPath);
   if (NULL == dirSvcProvider)