summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-15 13:44:43 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-15 13:44:43 -0500
commit10ab4adc86207f86df30ab23d8858c23e7f550ea (patch)
treea571c32d491289f6f69147a6c7631b253e3773e0 /indra/llcommon/tests
parentc6ccdb5b5088f3ab24bb89d8c56049c7a17a663e (diff)
Fix llprocess_test.cpp's exception catching for Linux.
In the course of re-enabling the indra/test tests last year, Log generalized a workaround I'd introduced in llsdmessage_test.cpp. In Linux viewer land, a test program trying to catch an expected exception can't seem to catch it by its specific class (across the libllcommon.so boundary), but must instead catch std::runtime_error and validate the typeid().name() string. Log added a macro for this idiom in llevents_tut.cpp. Generalize that macro further for normal-case processing as well, move it to a header file of its own and use it in all known places -- plus the new exception-catching tests in llprocess_test.cpp.
Diffstat (limited to 'indra/llcommon/tests')
-rw-r--r--indra/llcommon/tests/llprocess_test.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 06f9f3827f..a901c577d6 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -31,6 +31,7 @@
#include "../test/lltut.h"
#include "../test/manageapr.h"
#include "../test/namedtempfile.h"
+#include "../test/catch_and_store_what_in.h"
#include "stringize.h"
#include "llsdutil.h"
#include "llevents.h"
@@ -952,10 +953,7 @@ namespace tut
{ \
CODE; \
} \
- catch (const EXCEPTION& e) \
- { \
- (THREW) = e.what(); \
- } \
+ CATCH_AND_STORE_WHAT_IN(THREW, EXCEPTION) \
ensure("failed to throw " #EXCEPTION ": " #CODE, ! (THREW).empty()); \
} while (0)