Bug 457046 - Decide what to do with <TestPipes.cpp> |#if 0|'ed code; Bv1; r=benjamin
authorSerge Gautherie <sgautherie.bz@free.fr>
Wed, 08 Oct 2008 02:27:05 +0200
changeset 20123 f87c1b3d0a192efcb0a5c41390def153303730e6
parent 20122 03bcf290b1fb742dbff57803c77fe2a1d4397d1d
child 20124 ea6ec55b087f60f275004aa580a8f876c8731077
push idunknown
push userunknown
push dateunknown
reviewersbenjamin
bugs457046
milestone1.9.1b2pre
Bug 457046 - Decide what to do with <TestPipes.cpp> |#if 0|'ed code; Bv1; r=benjamin
xpcom/io/nsSegmentedBuffer.cpp
xpcom/tests/Makefile.in
xpcom/tests/TestPipes.cpp
--- a/xpcom/io/nsSegmentedBuffer.cpp
+++ b/xpcom/io/nsSegmentedBuffer.cpp
@@ -162,17 +162,17 @@ nsSegmentedBuffer::Empty()
         }
         nsMemory::Free(mSegmentArray);
         mSegmentArray = nsnull;
     }
     mSegmentArrayCount = NS_SEGMENTARRAY_INITIAL_COUNT;
     mFirstSegmentIndex = mLastSegmentIndex = 0;
 }
 
-#ifdef DEBUG
+#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
 NS_COM void
 TestSegmentedBuffer()
 {
     nsSegmentedBuffer* buf = new nsSegmentedBuffer();
     NS_ASSERTION(buf, "out of memory");
     buf->Init(4, 16);
     char* seg;
     PRBool empty;
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -72,16 +72,17 @@ CPPSRCS		= \
 		TestID.cpp \
 		TestINIParser.cpp \
 		TestObserverService.cpp \
 		TestServMgr.cpp \
 		TestAutoPtr.cpp \
 		TestVersionComparator.cpp \
 		TestTextFormatter.cpp \
 		TestPipe.cpp \
+		TestPipes.cpp \
 		TestRacingServiceManager.cpp \
 		TestRegistrationOrder.cpp \
 		TestProxies.cpp \
 		TestThreadPoolListener.cpp \
 		TestTimers.cpp \
 		TestOOM.cpp \
 		$(NULL)
 
@@ -89,17 +90,16 @@ ifndef MOZ_ENABLE_LIBXUL
 CPPSRCS += \
 		TestArray.cpp \
 		TestTArray.cpp \
 		TestAtoms.cpp \
 		TestAutoLock.cpp \
 		TestCRT.cpp \
 		TestEncoding.cpp \
 		TestPermanentAtoms.cpp \
-		TestPipes.cpp \
 		TestThreads.cpp \
 		TestThreadPool.cpp \
 		TestXPIDLString.cpp \
 		TestDeque.cpp \
 		TestStrings.cpp \
 		TestStorageStream.cpp \
 		TestExpirationTracker.cpp \
 		$(NULL)
@@ -137,31 +137,31 @@ CPP_UNIT_TESTS = \
   TestAutoPtr \
   TestCOMPtr \
   TestCOMPtrEq \
   TestFactory \
   TestHashtables \
   TestID \
   TestObserverService \
   TestPipe \
+  TestPipes \
   TestRacingServiceManager \
   TestServMgr \
   TestTextFormatter \
   TestThreadPoolListener \
   TestTimers \
   $(NULL)
 
 ifndef MOZ_ENABLE_LIBXUL
 CPP_UNIT_TESTS += \
   TestArray \
   TestAutoLock \
   TestCRT \
   TestEncoding \
   TestExpirationTracker \
-  TestPipes \
   TestProxies \
   TestThreads \
   TestThreadPool \
   TestXPIDLString \
   TestDeque \
   TestStrings \
   TestStorageStream \
   TestTArray \
--- a/xpcom/tests/TestPipes.cpp
+++ b/xpcom/tests/TestPipes.cpp
@@ -507,34 +507,34 @@ TestSearch(const char* delim, PRUint32 s
         bufferContents[bufDataSize] = '\0';
         printf("Buffer: %s\nDelim: %s %s offset: %d\n", bufferContents,
                delim, (found ? "found" : "not found"), offset);
     }
 }
 #endif
 ////////////////////////////////////////////////////////////////////////////////
 
-#ifdef DEBUG
+#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
 extern NS_COM void
 TestSegmentedBuffer();
 #endif
 
 int
 main(int argc, char* argv[])
 {
     nsresult rv;
 
     nsCOMPtr<nsIServiceManager> servMgr;
     rv = NS_InitXPCOM2(getter_AddRefs(servMgr), NULL, NULL);
     if (NS_FAILED(rv)) return rv;
 
     if (argc > 1 && nsCRT::strcmp(argv[1], "-trace") == 0)
         gTrace = PR_TRUE;
 
-#ifdef DEBUG
+#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
     printf("Testing segmented buffer...\n");
     TestSegmentedBuffer();
 #endif
 
 #if 0
     TestSearch("foo", 8);
     TestSearch("bar", 6);
     TestSearch("baz", 2);