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/llinstancetracker_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/llinstancetracker_test.cpp')
-rw-r--r-- | indra/llcommon/tests/llinstancetracker_test.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index c7d4b8a06b..0fe65f0831 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -198,14 +198,9 @@ namespace tut { WrapLLErrs wrapper; Keyed::instance_iter i(Keyed::beginInstances()); - try - { - delete keyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = catch_llerrs([&keyed](){ + delete keyed; + }); } ensure(! what.empty()); } @@ -219,14 +214,9 @@ namespace tut { WrapLLErrs wrapper; Keyed::key_iter i(Keyed::beginKeys()); - try - { - delete keyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = catch_llerrs([&keyed](){ + delete keyed; + }); } ensure(! what.empty()); } @@ -240,14 +230,9 @@ namespace tut { WrapLLErrs wrapper; Unkeyed::instance_iter i(Unkeyed::beginInstances()); - try - { - delete unkeyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = catch_llerrs([&unkeyed](){ + delete unkeyed; + }); } ensure(! what.empty()); } |