summaryrefslogtreecommitdiff
path: root/indra/test
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-09-09 14:20:19 -0400
committerLogan Dethrow <log@lindenlab.com>2011-09-09 14:20:19 -0400
commit8a952e42e97cfb286192aba0fbfc43986912cd29 (patch)
tree6aa00aad42189239aa81972328e057afc215bf7d /indra/test
parentc47b398b75fcdbb479ad9ad2765014c5fa338df7 (diff)
parent89b9800579a37fbbdfca7789716a2d012d96cfa5 (diff)
Removed some spurious newlines that I introduced into CMakeLists.txt.
Diffstat (limited to 'indra/test')
-rw-r--r--indra/test/io.cpp32
-rw-r--r--indra/test/lliohttpserver_tut.cpp6
-rw-r--r--indra/test/lltemplatemessagebuilder_tut.cpp2
-rw-r--r--indra/test/message_tut.cpp2
-rw-r--r--indra/test/test.cpp17
5 files changed, 14 insertions, 45 deletions
diff --git a/indra/test/io.cpp b/indra/test/io.cpp
index c06c1b153b..c8e53e77a0 100644
--- a/indra/test/io.cpp
+++ b/indra/test/io.cpp
@@ -823,22 +823,19 @@ namespace tut
class PumpAndChainTestData
{
protected:
- apr_pool_t* mPool;
LLPumpIO* mPump;
LLPumpIO::chain_t mChain;
public:
PumpAndChainTestData()
{
- apr_pool_create(&mPool, NULL);
- mPump = new LLPumpIO(mPool);
+ mPump = new LLPumpIO();
}
~PumpAndChainTestData()
{
mChain.clear();
delete mPump;
- apr_pool_destroy(mPool);
}
};
typedef test_group<PumpAndChainTestData> PumpAndChainTestGroup;
@@ -910,10 +907,8 @@ namespace tut
pipe_and_pump_fitness()
{
LLFrameTimer::updateFrameTime();
- apr_pool_create(&mPool, NULL);
- mPump = new LLPumpIO(mPool);
+ mPump = new LLPumpIO();
mSocket = LLSocket::create(
- mPool,
LLSocket::STREAM_TCP,
SERVER_LISTEN_PORT);
}
@@ -922,7 +917,6 @@ namespace tut
{
mSocket.reset();
delete mPump;
- apr_pool_destroy(mPool);
}
protected:
@@ -948,7 +942,6 @@ namespace tut
new LLPipeStringInjector("suckers never play me"));
boost::shared_ptr<LLChainIOFactory> factory(emitter);
LLIOServerSocket* server = new LLIOServerSocket(
- mPool,
mSocket,
factory);
server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
@@ -963,7 +956,7 @@ namespace tut
// Set up the client
//lldebugs << "fitness_test_object::test<1> - connecting client."
// << llendl;
- LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
+ LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
@@ -995,7 +988,6 @@ namespace tut
emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
boost::shared_ptr<LLChainIOFactory> factory(emitter);
LLIOServerSocket* server = new LLIOServerSocket(
- mPool,
mSocket,
factory);
server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
@@ -1006,7 +998,7 @@ namespace tut
pump_loop(mPump, 0.1f);
// Set up the client
- LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
+ LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
@@ -1038,7 +1030,6 @@ namespace tut
emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
boost::shared_ptr<LLChainIOFactory> factory(emitter);
LLIOServerSocket* server = new LLIOServerSocket(
- mPool,
mSocket,
factory);
server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
@@ -1049,7 +1040,7 @@ namespace tut
pump_loop(mPump, 0.1f);
// Set up the client
- LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
+ LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
@@ -1081,7 +1072,6 @@ namespace tut
emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
boost::shared_ptr<LLChainIOFactory> factory(emitter);
LLIOServerSocket* server = new LLIOServerSocket(
- mPool,
mSocket,
factory);
server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS + 1.80f);
@@ -1092,7 +1082,7 @@ namespace tut
pump_loop(mPump, 0.1f);
// Set up the client
- LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
+ LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
@@ -1122,7 +1112,6 @@ namespace tut
sleeper_t* sleeper = new sleeper_t(new LLIOSleeper);
boost::shared_ptr<LLChainIOFactory> factory(sleeper);
LLIOServerSocket* server = new LLIOServerSocket(
- mPool,
mSocket,
factory);
server->setResponseTimeout(1.0);
@@ -1135,7 +1124,7 @@ namespace tut
lldebugs << "** Server is up." << llendl;
// Set up the client
- LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
+ LLSocket::ptr_t client = LLSocket::create(LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
@@ -1249,19 +1238,16 @@ namespace tut
}
};
- apr_pool_t* mPool;
LLPumpIO* mPump;
LLPumpIO::chain_t mChain;
LLSimpleRPCClient* mClient;
LLSD mResponse;
rpc_server_data() :
- mPool(NULL),
mPump(NULL),
mClient(NULL)
{
- apr_pool_create(&mPool, NULL);
- mPump = new LLPumpIO(mPool);
+ mPump = new LLPumpIO();
mClient = new LLSimpleRPCClient(&mResponse);
mChain.push_back(LLIOPipe::ptr_t(mClient));
mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCRequest));
@@ -1276,8 +1262,6 @@ namespace tut
mChain.clear();
delete mPump;
mPump = NULL;
- apr_pool_destroy(mPool);
- mPool = NULL;
}
void pump_loop(const LLSD& request)
{
diff --git a/indra/test/lliohttpserver_tut.cpp b/indra/test/lliohttpserver_tut.cpp
index 2fdc455f45..b7274b662d 100644
--- a/indra/test/lliohttpserver_tut.cpp
+++ b/indra/test/lliohttpserver_tut.cpp
@@ -104,11 +104,8 @@ namespace tut
LLPipeStringInjector* injector = new LLPipeStringInjector(httpRequest);
LLPipeStringExtractor* extractor = new LLPipeStringExtractor();
- apr_pool_t* pool;
- apr_pool_create(&pool, NULL);
-
LLPumpIO* pump;
- pump = new LLPumpIO(pool);
+ pump = new LLPumpIO();
LLPumpIO::chain_t chain;
LLSD context;
@@ -131,7 +128,6 @@ namespace tut
chain.clear();
delete pump;
- apr_pool_destroy(pool);
if(mResponse.notNull() && timeout)
{
diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp
index 6e1c82bb24..fb3dd18fd3 100644
--- a/indra/test/lltemplatemessagebuilder_tut.cpp
+++ b/indra/test/lltemplatemessagebuilder_tut.cpp
@@ -29,7 +29,6 @@
#include "linden_common.h"
#include "lltut.h"
-#include "llapr.h"
#include "llmessagetemplate.h"
#include "llmath.h"
#include "llquaternion.h"
@@ -54,7 +53,6 @@ namespace tut
static bool init = false;
if(! init)
{
- ll_init_apr();
const F32 circuit_heartbeat_interval=5;
const F32 circuit_timeout=100;
diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp
index d971b33475..9a6ccd4d68 100644
--- a/indra/test/message_tut.cpp
+++ b/indra/test/message_tut.cpp
@@ -29,7 +29,6 @@
#include "linden_common.h"
#include "lltut.h"
-#include "llapr.h"
#include "llmessageconfig.h"
#include "llsdserialize.h"
#include "llversionserver.h"
@@ -62,7 +61,6 @@ namespace tut
static bool init = false;
if(!init)
{
- ll_init_apr();
//init_prehash_data();
init = true;
}
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index ffdb0cb976..45e8aef99a 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -37,8 +37,8 @@
#include "linden_common.h"
#include "llerrorcontrol.h"
#include "lltut.h"
+#include "llaprpool.h"
-#include "apr_pools.h"
#include "apr_getopt.h"
// the CTYPE_WORKAROUND is needed for linux dev stations that don't
@@ -349,17 +349,12 @@ int main(int argc, char **argv)
ctype_workaround();
#endif
- apr_initialize();
- apr_pool_t* pool = NULL;
- if(APR_SUCCESS != apr_pool_create(&pool, NULL))
- {
- std::cerr << "Unable to initialize pool" << std::endl;
- return 1;
- }
+ LLAPRPool pool;
+ pool.create();
apr_getopt_t* os = NULL;
- if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv))
+ if(APR_SUCCESS != apr_getopt_init(&os, pool(), argc, argv))
{
- std::cerr << "Unable to pool" << std::endl;
+ std::cerr << "Unable to initialize the arguments for parsing by apr_getopt()." << std::endl;
return 1;
}
@@ -477,8 +472,6 @@ int main(int argc, char **argv)
s.close();
}
- apr_terminate();
-
int retval = (success ? 0 : 1);
return retval;