From 3c341a11ab7b8f3fd18afcf3f50af6dfafa632c2 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 8 Jan 2013 00:25:07 -0800
Subject: SH-3468 WIP add memory tracking base class more fixes for unit test
 crashes added llcommon initialization/teardown for unit tests that indirectly
 trigger lltrace changed access of atomic refcount to use
 preincrement/decrement operators to reflect desired semantics always call
 apr_initialize in LLCommon::initClass, even if already initialized...apr does
 internal reference counting to keep things straight

---
 indra/test/io.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'indra/test/io.cpp')

diff --git a/indra/test/io.cpp b/indra/test/io.cpp
index ce747f667d..f2b4a5339c 100644
--- a/indra/test/io.cpp
+++ b/indra/test/io.cpp
@@ -44,6 +44,7 @@
 #include "llsdrpcclient.h"
 #include "llsdrpcserver.h"
 #include "llsdserialize.h"
+#include "llcommon.h"
 #include "lluuid.h"
 #include "llinstantmessage.h"
 
@@ -830,6 +831,7 @@ namespace tut
 	public:
 		PumpAndChainTestData()
 		{
+			LLCommon::initClass();
 			apr_pool_create(&mPool, NULL);
 			mPump = new LLPumpIO(mPool);
 		}
@@ -839,6 +841,7 @@ namespace tut
 			mChain.clear();
 			delete mPump;
 			apr_pool_destroy(mPool);
+			LLCommon::cleanupClass();
 		}
 	};
 	typedef test_group<PumpAndChainTestData>	PumpAndChainTestGroup;
@@ -909,6 +912,7 @@ namespace tut
 		
 		pipe_and_pump_fitness()
 		{
+			LLCommon::initClass();
 			LLFrameTimer::updateFrameTime();
 			apr_pool_create(&mPool, NULL);
 			mPump = new LLPumpIO(mPool);
@@ -923,6 +927,7 @@ namespace tut
 			mSocket.reset();
 			delete mPump;
 			apr_pool_destroy(mPool);
+			LLCommon::cleanupClass();
 		}
 
 	protected:
@@ -1186,8 +1191,12 @@ namespace tut
 			LLSimpleRPCResponse(LLSD* response) :
 				mResponsePtr(response)
 			{
+				LLCommon::initClass();
+			}
+			~LLSimpleRPCResponse() 
+			{
+				LLCommon::cleanupClass();
 			}
-			~LLSimpleRPCResponse() {}
 			virtual bool response(LLPumpIO* pump)
 			{
 				*mResponsePtr = mReturnValue;
-- 
cgit v1.2.3


From 0ba9a00c3116b69745f2d5070ce772d5d4965dbf Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 8 Jan 2013 23:50:27 -0800
Subject: SH-3468 WIP add memory tracking base class cleaned up hacks used to
 get unit tests working LLTrace::init now supports recursive
 initialization/cleanup put NOMINMAX back in win32 header wrappers

---
 indra/test/io.cpp | 6 ------
 1 file changed, 6 deletions(-)

(limited to 'indra/test/io.cpp')

diff --git a/indra/test/io.cpp b/indra/test/io.cpp
index f2b4a5339c..b3eabc2e8a 100644
--- a/indra/test/io.cpp
+++ b/indra/test/io.cpp
@@ -831,7 +831,6 @@ namespace tut
 	public:
 		PumpAndChainTestData()
 		{
-			LLCommon::initClass();
 			apr_pool_create(&mPool, NULL);
 			mPump = new LLPumpIO(mPool);
 		}
@@ -841,7 +840,6 @@ namespace tut
 			mChain.clear();
 			delete mPump;
 			apr_pool_destroy(mPool);
-			LLCommon::cleanupClass();
 		}
 	};
 	typedef test_group<PumpAndChainTestData>	PumpAndChainTestGroup;
@@ -912,7 +910,6 @@ namespace tut
 		
 		pipe_and_pump_fitness()
 		{
-			LLCommon::initClass();
 			LLFrameTimer::updateFrameTime();
 			apr_pool_create(&mPool, NULL);
 			mPump = new LLPumpIO(mPool);
@@ -927,7 +924,6 @@ namespace tut
 			mSocket.reset();
 			delete mPump;
 			apr_pool_destroy(mPool);
-			LLCommon::cleanupClass();
 		}
 
 	protected:
@@ -1191,11 +1187,9 @@ namespace tut
 			LLSimpleRPCResponse(LLSD* response) :
 				mResponsePtr(response)
 			{
-				LLCommon::initClass();
 			}
 			~LLSimpleRPCResponse() 
 			{
-				LLCommon::cleanupClass();
 			}
 			virtual bool response(LLPumpIO* pump)
 			{
-- 
cgit v1.2.3