From 620b63a31667d93d9186217eb355d05e71ff245c Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Thu, 20 Oct 2011 11:20:41 -0400 Subject: Fixed test build issues caused by merging. Still encountering pthread assert after running indra/test --- indra/test/io.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index c8e53e77a0..38f86b9e57 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -823,13 +823,15 @@ namespace tut class PumpAndChainTestData { protected: + apr_pool_t* mPool; LLPumpIO* mPump; LLPumpIO::chain_t mChain; public: PumpAndChainTestData() { - mPump = new LLPumpIO(); + apr_pool_create(&mPool, NULL); + mPump = new LLPumpIO(mPool); } ~PumpAndChainTestData() @@ -906,9 +908,12 @@ namespace tut pipe_and_pump_fitness() { - LLFrameTimer::updateFrameTime(); - mPump = new LLPumpIO(); + apr_pool_create(&mPool, NULL); + + LLFrameTimer::updateFrameTime(); + mPump = new LLPumpIO(mPool); mSocket = LLSocket::create( + mPool, LLSocket::STREAM_TCP, SERVER_LISTEN_PORT); } @@ -942,6 +947,7 @@ namespace tut new LLPipeStringInjector("suckers never play me")); boost::shared_ptr factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( + mPool, mSocket, factory); server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); @@ -956,7 +962,7 @@ namespace tut // Set up the client //lldebugs << "fitness_test_object::test<1> - connecting client." // << llendl; - LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP); + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); @@ -988,6 +994,7 @@ namespace tut emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); boost::shared_ptr factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( + mPool, mSocket, factory); server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); @@ -998,7 +1005,7 @@ namespace tut pump_loop(mPump, 0.1f); // Set up the client - LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP); + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); @@ -1030,6 +1037,7 @@ namespace tut emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); boost::shared_ptr factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( + mPool, mSocket, factory); server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); @@ -1040,7 +1048,7 @@ namespace tut pump_loop(mPump, 0.1f); // Set up the client - LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP); + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); @@ -1072,6 +1080,7 @@ namespace tut emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); boost::shared_ptr factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( + mPool, mSocket, factory); server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS + 1.80f); @@ -1082,7 +1091,7 @@ namespace tut pump_loop(mPump, 0.1f); // Set up the client - LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP); + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); @@ -1112,6 +1121,7 @@ namespace tut sleeper_t* sleeper = new sleeper_t(new LLIOSleeper); boost::shared_ptr factory(sleeper); LLIOServerSocket* server = new LLIOServerSocket( + mPool, mSocket, factory); server->setResponseTimeout(1.0); @@ -1124,7 +1134,7 @@ namespace tut lldebugs << "** Server is up." << llendl; // Set up the client - LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP); + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); @@ -1242,12 +1252,14 @@ namespace tut LLPumpIO::chain_t mChain; LLSimpleRPCClient* mClient; LLSD mResponse; + apr_pool_t* mPool; rpc_server_data() : mPump(NULL), mClient(NULL) { - mPump = new LLPumpIO(); + apr_pool_create(&mPool, NULL); + mPump = new LLPumpIO(mPool); mClient = new LLSimpleRPCClient(&mResponse); mChain.push_back(LLIOPipe::ptr_t(mClient)); mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCRequest)); -- cgit v1.2.3 From 182566800a834df8cb12fb03a869b216ad13cd84 Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Fri, 18 Nov 2011 12:33:07 -0500 Subject: Re-added some missing calls to apr_pool_destroy() that I failed to readd after the thread local storage rollback. Also added a call to LLProxy::cleanupClass() to prevent indra/test from segfaulting on exit. --- indra/test/io.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 38f86b9e57..ce747f667d 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -838,6 +838,7 @@ namespace tut { mChain.clear(); delete mPump; + apr_pool_destroy(mPool); } }; typedef test_group PumpAndChainTestGroup; @@ -908,9 +909,8 @@ namespace tut pipe_and_pump_fitness() { - apr_pool_create(&mPool, NULL); - LLFrameTimer::updateFrameTime(); + apr_pool_create(&mPool, NULL); mPump = new LLPumpIO(mPool); mSocket = LLSocket::create( mPool, @@ -922,6 +922,7 @@ namespace tut { mSocket.reset(); delete mPump; + apr_pool_destroy(mPool); } protected: @@ -1248,13 +1249,14 @@ namespace tut } }; + apr_pool_t* mPool; LLPumpIO* mPump; LLPumpIO::chain_t mChain; LLSimpleRPCClient* mClient; LLSD mResponse; - apr_pool_t* mPool; rpc_server_data() : + mPool(NULL), mPump(NULL), mClient(NULL) { @@ -1274,6 +1276,8 @@ namespace tut mChain.clear(); delete mPump; mPump = NULL; + apr_pool_destroy(mPool); + mPool = NULL; } void pump_loop(const LLSD& request) { -- cgit v1.2.3