Changes in src/Helpers/Assert.hpp [986ed3:506d2f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Helpers/Assert.hpp
r986ed3 r506d2f 234 234 static bool ignore = false;\ 235 235 if(!ignore){\ 236 if( Assert::_my_assert::check((condition),STRINGIFY(condition),(message),\237 __FILE__,__LINE__,ignore)){\236 if(!(condition) && Assert::_my_assert::check(STRINGIFY(condition),(message),\ 237 __FILE__,__LINE__,ignore)){\ 238 238 Assert::_my_assert::doHooks();\ 239 239 DEBUG_BREAK;\ … … 247 247 static bool ignore = false; \ 248 248 if(!ignore){\ 249 if(Assert::_my_assert::check( false,"Exception caught",(message),__FILE__,__LINE__,ignore)){\249 if(Assert::_my_assert::check("Exception caught",(message),__FILE__,__LINE__,ignore)){\ 250 250 Assert::_my_assert::doHooks();\ 251 DEBUG_BREAK;\251 DEBUG_BREAK;\ 252 252 }\ 253 253 }\ … … 299 299 class _my_assert{ 300 300 public: 301 static bool check(const bool res, 302 const char* condition, 301 static bool check(const char* condition, 303 302 const char* message, 304 303 const char* filename, 305 304 const int line, 306 305 bool& ignore); 306 #ifdef __GNUC__ 307 static void backtrace(const char *file, int line); 308 #endif /* __GNUC__ */ 307 309 static void addHook(Assert::hook_t hook); 308 310 static void removeHook(Assert::hook_t hook); … … 332 334 333 335 if(!ignore){ 334 if(_my_assert::check(dynamic_cast<target>(src)==static_cast<target>(src),"type-safe typecast",335 336 bool res = dynamic_cast<target>(src)==static_cast<target>(src); 337 if(!res && _my_assert::check("type-safe typecast",message_ptr,file,line,ignore)){ 336 338 _my_assert::doHooks(); 337 339 DEBUG_BREAK; … … 354 356 catch(...){ 355 357 if(!ignore){ 356 if(_my_assert::check( 0,"type-safe typecast",message_ref,file,line,ignore)){358 if(_my_assert::check("type-safe typecast",message_ref,file,line,ignore)){ 357 359 _my_assert::doHooks(); 358 360 DEBUG_BREAK;
Note:
See TracChangeset
for help on using the changeset viewer.