diff options
Diffstat (limited to 'indra/test/test.cpp')
-rw-r--r-- | indra/test/test.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 87c4a8d8a3..571f502861 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -75,7 +75,18 @@ #include <fstream> -void wouldHaveCrashed(const std::string& message); +LLError::ErrFatalHookResult wouldHaveCrashed(const std::string& message) +{ +#if LL_MSVC +#pragma warning (push) +#pragma warning (disable : 4702) // warning C4702: unreachable code +#endif + tut::fail("fatal error message: " + message); + return LLError::ERR_DO_NOT_CRASH; +#if LL_MSVC +#pragma warning (pop) +#endif +} namespace tut { @@ -146,7 +157,7 @@ public: mOldSettings(LLError::saveAndResetSettings()), mRecorder(new RecordToTempFile(pool)) { - LLError::setFatalFunction(wouldHaveCrashed); + LLError::setFatalHook(wouldHaveCrashed); LLError::setDefaultLevel(level); LLError::addRecorder(mRecorder); } @@ -512,11 +523,6 @@ void stream_groups(std::ostream& s, const char* app) } } -void wouldHaveCrashed(const std::string& message) -{ - tut::fail("llerrs message: " + message); -} - static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; int main(int argc, char **argv) @@ -626,7 +632,7 @@ int main(int argc, char **argv) replayer.reset(new LLReplayLogReal(level, gAPRPoolp)); } } - LLError::setFatalFunction(wouldHaveCrashed); + LLError::setFatalHook(wouldHaveCrashed); std::string test_app_name(argv[0]); std::string test_log = test_app_name + ".log"; LLFile::remove(test_log); |