aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/tests/CppTestHarness/Test.cpp
diff options
context:
space:
mode:
authordan miller2007-10-19 05:15:33 +0000
committerdan miller2007-10-19 05:15:33 +0000
commit79eca25c945a535a7a0325999034bae17da92412 (patch)
tree40ff433d94859d629aac933d5ec73b382f62ba1a /libraries/ode-0.9/tests/CppTestHarness/Test.cpp
parentadding ode source to /libraries (diff)
downloadopensim-SC_OLD-79eca25c945a535a7a0325999034bae17da92412.zip
opensim-SC_OLD-79eca25c945a535a7a0325999034bae17da92412.tar.gz
opensim-SC_OLD-79eca25c945a535a7a0325999034bae17da92412.tar.bz2
opensim-SC_OLD-79eca25c945a535a7a0325999034bae17da92412.tar.xz
resubmitting ode
Diffstat (limited to 'libraries/ode-0.9/tests/CppTestHarness/Test.cpp')
-rw-r--r--libraries/ode-0.9/tests/CppTestHarness/Test.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/libraries/ode-0.9/tests/CppTestHarness/Test.cpp b/libraries/ode-0.9/tests/CppTestHarness/Test.cpp
new file mode 100644
index 0000000..44b2dd8
--- /dev/null
+++ b/libraries/ode-0.9/tests/CppTestHarness/Test.cpp
@@ -0,0 +1,49 @@
1#include "Test.h"
2#include "TestResults.h"
3
4#ifdef TRANSLATE_POSIX_SIGNALS
5 #include "SignalTranslator.h"
6#endif
7
8namespace CppTestHarness
9{
10
11Test::Test(std::string const testName, std::string const filename, int const lineNumber)
12 : m_testName(testName)
13 , m_filename(filename)
14 , m_lineNumber(lineNumber)
15{
16}
17
18Test::~Test()
19{
20}
21
22void Test::Run(TestResults& testResults)
23{
24 try
25 {
26#ifdef TRANSLATE_POSIX_SIGNALS
27 //add any signals you want translated into system exceptions here
28 SignalTranslator<SIGSEGV> sigSEGV;
29 SignalTranslator<SIGFPE> sigFPE;
30 SignalTranslator<SIGBUS> sigBUS;
31#endif
32 RunImpl(testResults);
33 }
34 catch (std::exception const& e)
35 {
36 std::string msg = "Unhandled exception: ";
37 msg += e.what();
38 testResults.ReportFailure(m_filename.c_str(), m_lineNumber, msg);
39 }
40 catch (...)
41 {
42 testResults.ReportFailure(m_filename.c_str(), m_lineNumber, "Unhandled exception: crash!");
43 }
44
45
46 testResults.ReportDone(m_testName);
47}
48}
49