Assert.h revision 10447:a465576671d4
1#ifndef __ASSERT_H__ 2#define __ASSERT_H__ 3 4#include "String.h" 5#include "Exception.h" 6 7#ifdef NDEBUG 8#define ASSERT(test_value_,exception_msg_) 9#else 10#define ASSERT(test_value_,msg_) \ 11 do \ 12 { \ 13 if(!(test_value_)) \ 14 { \ 15 const LibUtil::String& exception_msg = LibUtil::String::format("\nAt %s:%d\n", __FILE__, __LINE__) + (String)(msg_); \ 16 throw LibUtil::Exception(exception_msg); \ 17 } \ 18 } while(0); 19#endif 20 21#endif // __ASSERT_H__ 22 23