added exception translation to examples - relates #12
diff --git a/examples/dll_and_executable/main.cpp b/examples/dll_and_executable/main.cpp
index 32f5d70..bd94da7 100644
--- a/examples/dll_and_executable/main.cpp
+++ b/examples/dll_and_executable/main.cpp
@@ -5,6 +5,7 @@
TEST_CASE("executable") {
printf("I am a test from the executable!\n");
+ throw 'a';
}
#ifdef _WIN32
@@ -24,6 +25,11 @@
#endif // __APPLE__
#endif // _WIN32
+// set an exception translator for double
+REGISTER_EXCEPTION_TRANSLATOR(double& e) {
+ return doctest::String("double: ") + doctest::toString(e);
+}
+
int main(int argc, char** argv) {
// force the use of a symbol from the dll so tests from it get registered
DOCTEST_SYMBOL_IMPORT void from_dll(); from_dll();