summaryrefslogtreecommitdiff
path: root/indra/llmessage/tests
diff options
context:
space:
mode:
authorMichael Pohoreski <ptolemy@lindenlab.com>2019-11-20 17:10:22 -0800
committerMichael Pohoreski <ptolemy@lindenlab.com>2019-11-20 17:10:22 -0800
commit4b205db468fd371dfe1bb30bb887e2ccbd7044ec (patch)
tree6d83efd5ebc0c2a462f33f1b385c5b415a93cb49 /indra/llmessage/tests
parent18eb8ac90ce409ba620f6fe8ff487e6195d9c3eb (diff)
parent24920de799c8e2dd26854923c7a10fc4a551dd5d (diff)
Merged lindenlab/viewer-eep into default
Diffstat (limited to 'indra/llmessage/tests')
-rw-r--r--indra/llmessage/tests/llareslistener_test.cpp48
1 files changed, 12 insertions, 36 deletions
diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp
index c04696c86b..254185cbd0 100644
--- a/indra/llmessage/tests/llareslistener_test.cpp
+++ b/indra/llmessage/tests/llareslistener_test.cpp
@@ -138,15 +138,9 @@ namespace tut
WrapLLErrs capture;
LLSD request;
request["op"] = "foo";
- std::string threw;
- try
- {
- LLEventPumps::instance().obtain("LLAres").post(request);
- }
- catch (const WrapLLErrs::FatalException& e)
- {
- threw = e.what();
- }
+ std::string threw = capture.catch_llerrs([&request](){
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ });
ensure_contains("LLAresListener bad op", threw, "bad");
}
@@ -157,15 +151,9 @@ namespace tut
WrapLLErrs capture;
LLSD request;
request["op"] = "rewriteURI";
- std::string threw;
- try
- {
- LLEventPumps::instance().obtain("LLAres").post(request);
- }
- catch (const WrapLLErrs::FatalException& e)
- {
- threw = e.what();
- }
+ std::string threw = capture.catch_llerrs([&request](){
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ });
ensure_contains("LLAresListener bad req", threw, "missing");
ensure_contains("LLAresListener bad req", threw, "reply");
ensure_contains("LLAresListener bad req", threw, "uri");
@@ -179,15 +167,9 @@ namespace tut
LLSD request;
request["op"] = "rewriteURI";
request["reply"] = "nonexistent";
- std::string threw;
- try
- {
- LLEventPumps::instance().obtain("LLAres").post(request);
- }
- catch (const WrapLLErrs::FatalException& e)
- {
- threw = e.what();
- }
+ std::string threw = capture.catch_llerrs([&request](){
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ });
ensure_contains("LLAresListener bad req", threw, "missing");
ensure_contains("LLAresListener bad req", threw, "uri");
ensure_does_not_contain("LLAresListener bad req", threw, "reply");
@@ -201,15 +183,9 @@ namespace tut
LLSD request;
request["op"] = "rewriteURI";
request["uri"] = "foo.bar.com";
- std::string threw;
- try
- {
- LLEventPumps::instance().obtain("LLAres").post(request);
- }
- catch (const WrapLLErrs::FatalException& e)
- {
- threw = e.what();
- }
+ std::string threw = capture.catch_llerrs([&request](){
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ });
ensure_contains("LLAresListener bad req", threw, "missing");
ensure_contains("LLAresListener bad req", threw, "reply");
ensure_does_not_contain("LLAresListener bad req", threw, "uri");