From 49edbdc00bab220068302f784af6fa3d67c73b08 Mon Sep 17 00:00:00 2001 From: Alek Mosingiewicz Date: Tue, 3 Apr 2018 18:26:45 +0200 Subject: [PATCH] Actually catch the exception? --- unittests/multithreaded_test.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/unittests/multithreaded_test.cpp b/unittests/multithreaded_test.cpp index 483afe0d..9ff70da2 100644 --- a/unittests/multithreaded_test.cpp +++ b/unittests/multithreaded_test.cpp @@ -111,15 +111,22 @@ int main() { std::stringstream ss; ss << i; - if (chai.eval("getvalue(" + ss.str() + ")") != expected_value(4000)) + try { + if (chai.eval("getvalue(" + ss.str() + ")") != expected_value(4000)) + { + return EXIT_FAILURE; + } + + if (chai.eval("getid(" + ss.str() + ")") != static_cast(i)) + { + return EXIT_FAILURE; + } + } catch (chaiscript::exception::eval_error &e) { + std::cout << e.what(); return EXIT_FAILURE; } - if (chai.eval("getid(" + ss.str() + ")") != static_cast(i)) - { - return EXIT_FAILURE; - } } return EXIT_SUCCESS;