25 #ifndef WEXCEPTION_TEST_H
26 #define WEXCEPTION_TEST_H
31 #include <boost/shared_ptr.hpp>
33 #include <cxxtest/TestSuite.h>
35 #include "../WException.h"
49 TS_ASSERT_THROWS_NOTHING(
WException e( std::string(
"Some message" ) ) );
57 WException e( std::string(
"Dummy exception" ) );
59 e.
m_trace.push_back(
"second" );
60 std::string expected =
"Dummy exception\n\ntrace: first\ntrace: second";
61 TS_ASSERT_EQUALS( expected, e.
getTrace() );
63 TS_ASSERT_EQUALS( std::string(), f.getTrace() );
71 #if ( defined( __linux__ ) && defined( __GNUC__ ) )
81 TS_ASSERT( bt.length() );
90 #endif // WEXCEPTION_TEST_H
std::string getTrace() const
Prints the trace of the call chain which caused this exception.
std::string getBacktrace() const
Returns a call stacktrace.
void testGetMessage(void)
Getting the message means every trace element should be returned.
std::list< std::string > m_trace
Stack trace for identifying the source where this exception came from.
void testInstantiation(void)
An instantiation should never throw an exception.
void testBacktrace(void)
Test backtrace.