45 #if defined( GLS_DEBUG ) && defined( GLS_UNIT_TEST )
46 #pragma BullseyeCoverage save off
52 class GlsAssertionFailure :
public std::exception
60 GlsAssertionFailure(
const char*
const msg ) :
64 _glsAssertIsEnabled =
false;
71 ~GlsAssertionFailure() { _glsAssertIsEnabled =
true; }
83 static bool GlsAssertIsEnabled(
void ) {
return( _glsAssertIsEnabled ); }
86 static bool _glsAssertIsEnabled;
89 #pragma BullseyeCoverage restore
90 #endif // ( GLS_DEBUG && GLS_UNIT_TEST )
92 #if defined( GLS_DEBUG )
93 #if defined( GLS_UNIT_TEST )
95 #define GlsAssert( _exp ) if( !( _exp ) && GlsAssertionFailure::GlsAssertIsEnabled() ) \
97 std::ostringstream msg; \
98 msg << "( " << #_exp << " ) at " << __FILE__ << " (" << __LINE__ << ")"; \
99 throw( GlsAssertionFailure( msg.str().c_str() ) ); \
104 #define GlsAssert( _exp ) assert( _exp )
105 #endif // GLS_UNIT_TEST
108 #define GlsAssert( _exp )
109 #endif // defined( GLS_DEBUG )
111 #define GlsError() GlsAssert( false )
113 #endif // _GLS_ASSERT_H
This header defines any preprocessor defines needed to configure the GL Studio DO-178B Runtime Librar...