diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-08-10 20:33:59 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2019-08-10 20:33:59 -0400 |
commit | adb3f447b33e42bdb6e4a5a1ac79eebd862dafb4 (patch) | |
tree | 707a9c35c7568782a7c7f968c6846b4646e84be3 /indra/llcommon/tests/lllazy_test.cpp | |
parent | 8053bceaa0ccd6128536375c21cc3e9e19429efa (diff) |
DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.
Use them in place of awkward try/catch test boilerplate.
Diffstat (limited to 'indra/llcommon/tests/lllazy_test.cpp')
-rw-r--r-- | indra/llcommon/tests/lllazy_test.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/indra/llcommon/tests/lllazy_test.cpp b/indra/llcommon/tests/lllazy_test.cpp index 32a717f4fc..542306ee22 100644 --- a/indra/llcommon/tests/lllazy_test.cpp +++ b/indra/llcommon/tests/lllazy_test.cpp @@ -38,6 +38,7 @@ #include <boost/lambda/bind.hpp> // other Linden headers #include "../test/lltut.h" +#include "../test/catch_and_store_what_in.h" namespace bll = boost::lambda; @@ -200,15 +201,9 @@ namespace tut void lllazy_object::test<2>() { TestNeedsTesting tnt; - std::string threw; - try - { - tnt.toolate(); - } - catch (const LLLazyCommon::InstanceChange& e) - { - threw = e.what(); - } + std::string threw = catch_what<LLLazyCommon::InstanceChange>([&tnt](){ + tnt.toolate(); + }); ensure_contains("InstanceChange exception", threw, "replace LLLazy instance"); } |