summaryrefslogtreecommitdiff
path: root/indra/test/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/test/test.cpp')
-rw-r--r--indra/test/test.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 9dd33c574d..f1c5991330 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -54,6 +54,12 @@
#endif
#ifndef LL_WINDOWS
+
+typedef struct {
+ void *re_pcre;
+ size_t re_nsub;
+ size_t re_erroffset;
+} regex_t;
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#endif
@@ -97,7 +103,7 @@ public:
class RecordToTempFile : public LLError::Recorder, public boost::noncopyable
{
public:
- RecordToTempFile(apr_pool_t* pPool)
+ RecordToTempFile()
: LLError::Recorder(),
boost::noncopyable(),
mTempFile("log", ""),
@@ -141,11 +147,11 @@ private:
class LLReplayLogReal: public LLReplayLog, public boost::noncopyable
{
public:
- LLReplayLogReal(LLError::ELevel level, apr_pool_t* pool)
+ LLReplayLogReal(LLError::ELevel level)
: LLReplayLog(),
boost::noncopyable(),
mOldSettings(LLError::saveAndResetSettings()),
- mRecorder(new RecordToTempFile(pool))
+ mRecorder(new RecordToTempFile())
{
LLError::setFatalFunction(wouldHaveCrashed);
LLError::setDefaultLevel(level);
@@ -160,12 +166,12 @@ public:
virtual void reset()
{
- boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();
+ std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();
}
virtual void replay(std::ostream& out)
{
- boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);
+ std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);
}
private:
@@ -179,7 +185,7 @@ class LLTestCallback : public chained_callback
public:
LLTestCallback(bool verbose_mode, std::ostream *stream,
- boost::shared_ptr<LLReplayLog> replayer) :
+ std::shared_ptr<LLReplayLog> replayer) :
mVerboseMode(verbose_mode),
mTotalTests(0),
mPassedTests(0),
@@ -187,7 +193,7 @@ public:
mSkippedTests(0),
// By default, capture a shared_ptr to std::cout, with a no-op "deleter"
// so that destroying the shared_ptr makes no attempt to delete std::cout.
- mStream(boost::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})),
+ mStream(std::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})),
mReplayer(replayer)
{
if (stream)
@@ -201,7 +207,7 @@ public:
// Allocate and assign in two separate steps, per Herb Sutter.
// (Until we turn on C++11 support, have to wrap *stream with
// boost::ref() due to lack of perfect forwarding.)
- boost::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));
+ std::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));
mStream = pstream;
}
}
@@ -259,7 +265,7 @@ public:
break;
case tut::test_result::ex:
++mFailedTests;
- out << "exception: " << tr.exception_typeid;
+ out << "exception: " << LLError::Log::demangle(tr.exception_typeid.c_str());
break;
case tut::test_result::warn:
++mFailedTests;
@@ -325,8 +331,8 @@ protected:
int mPassedTests;
int mFailedTests;
int mSkippedTests;
- boost::shared_ptr<std::ostream> mStream;
- boost::shared_ptr<LLReplayLog> mReplayer;
+ std::shared_ptr<std::ostream> mStream;
+ std::shared_ptr<LLReplayLog> mReplayer;
};
// TeamCity specific class which emits service messages
@@ -336,7 +342,7 @@ class LLTCTestCallback : public LLTestCallback
{
public:
LLTCTestCallback(bool verbose_mode, std::ostream *stream,
- boost::shared_ptr<LLReplayLog> replayer) :
+ std::shared_ptr<LLReplayLog> replayer) :
LLTestCallback(verbose_mode, stream, replayer)
{
}
@@ -401,7 +407,7 @@ public:
{
// Per http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages
std::string result;
- BOOST_FOREACH(char c, str)
+ for (char c : str)
{
switch (c)
{
@@ -549,7 +555,7 @@ int main(int argc, char **argv)
apr_status_t apr_err;
const char* opt_arg = NULL;
int opt_id = 0;
- boost::scoped_ptr<llofstream> output;
+ std::unique_ptr<llofstream> output;
const char *touch = NULL;
while(true)
@@ -608,7 +614,7 @@ int main(int argc, char **argv)
// set up logging
const char* LOGFAIL = getenv("LOGFAIL");
- boost::shared_ptr<LLReplayLog> replayer{boost::make_shared<LLReplayLog>()};
+ std::shared_ptr<LLReplayLog> replayer{std::make_shared<LLReplayLog>()};
// Testing environment variables for both 'set' and 'not empty' allows a
// user to suppress a pre-existing environment variable by forcing empty.
@@ -624,7 +630,7 @@ int main(int argc, char **argv)
if (LOGFAIL && *LOGFAIL)
{
LLError::ELevel level = LLError::decodeLevel(LOGFAIL);
- replayer.reset(new LLReplayLogReal(level, gAPRPoolp));
+ replayer.reset(new LLReplayLogReal(level));
}
}
LLError::setFatalFunction(wouldHaveCrashed);