00001 00033 #ifndef ITASSERT_H 00034 #define ITASSERT_H 00035 00036 #ifndef _MSC_VER 00037 # include <itpp/config.h> 00038 #else 00039 # include <itpp/config_msvc.h> 00040 #endif 00041 00042 #include <string> 00043 00044 00045 namespace itpp { 00046 00066 00067 00069 void it_assert_f(std::string ass, std::string msg, std::string file, int line); 00071 void it_error_f(std::string msg, std::string file, int line); 00073 void it_warning_f(std::string msg, std::string file, int line); 00074 00076 void it_enable_exceptions(bool on); 00078 void it_enable_warnings(); 00080 void it_disable_warnings(); 00082 void it_redirect_warnings(std::ostream *warn_stream); 00083 00084 #if ASSERT_LEVEL==0 // No tests 00085 # define it_assert0(t,s) ((void)0) 00086 # define it_assert1(t,s) ((void)0) 00087 #elif ASSERT_LEVEL==1 // Only some tests 00088 # define it_assert0(t,s) ((void)0) 00089 # define it_assert1(t,s) (void)((t) || (itpp::it_assert_f(#t,s,__FILE__,__LINE__),0)) 00090 #else // Full tests 00093 # define it_assert0(t,s) (void)((t) || (itpp::it_assert_f(#t,s,__FILE__,__LINE__),0)) 00097 # define it_assert1(t,s) (void)((t) || (itpp::it_assert_f(#t,s,__FILE__,__LINE__),0)) 00098 #endif // ASSERT_LEVEL 00099 00101 #define it_assert(t,s) (void)((t) || (itpp::it_assert_f(#t,s,__FILE__,__LINE__),0)) 00102 00103 #define it_error_if(t,s) (void)((!(t)) || (itpp::it_error_f(s,__FILE__,__LINE__),0)) 00104 00105 #define it_error(s) itpp::it_error_f(s,__FILE__,__LINE__) 00106 00107 #define it_warning(s) itpp::it_warning_f(s,__FILE__,__LINE__) 00108 00110 00111 } // namespace itpp 00112 00113 #endif // #ifndef ITASSERT_H
Generated on Fri Jan 11 08:51:36 2008 for IT++ by Doxygen 1.3.9.1