00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #define MOCKPP_NEED_EXPORTS
00031 #include <mockpp/mockpp.h>
00032
00033 #include <mockpp/compat/AssertionFailedError.h>
00034
00035
00036 MOCKPP_NS_START
00037
00038
00039 MOCKPP_API_IMPL0
00040 AssertionFailedError::AssertionFailedError (unsigned in_srcline, const char* in_srcfile,
00041 const String &in_msg)
00042 : Exception(in_srcline, in_srcfile, in_msg)
00043 {
00044 }
00045
00046
00047 MOCKPP_API_IMPL0
00048 AssertionFailedError::~AssertionFailedError() throw()
00049 {
00050 }
00051
00052
00053 MOCKPP_API_IMPL(void)
00054 assertionFailed(unsigned in_srcline, const String& in_srcfile,
00055 const String &in_message)
00056 {
00057 assertionFailed(in_srcline, getLatin1(in_srcfile).c_str(), in_message);
00058 }
00059
00060
00063 void defaultAssertionFailedForwarder(const AssertionFailedError &err)
00064 {
00065 MOCKPP_THROW(err);
00066 }
00067
00068
00072 AssertionFailedForwarder_t forwardAssertionFailed = defaultAssertionFailedForwarder;
00073
00074
00075 MOCKPP_API_IMPL(void)
00076 assertionFailed(unsigned srcline, const char* srcfile,
00077 const String &message)
00078 {
00079 if (forwardAssertionFailed != 0)
00080 forwardAssertionFailed(AssertionFailedError(srcline, srcfile, message));
00081 else
00082 defaultAssertionFailedForwarder(AssertionFailedError(srcline, srcfile, message));
00083 }
00084
00085
00086 MOCKPP_NS_END
00087
00088
00089