Update of /cvsroot/mockpp/mockpp/mockpp/compat
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6376/mockpp/compat
Modified Files:
Assert.cpp AssertionFailedError.cpp AssertionFailedError.h
Formatter.cpp
Log Message:
only assertionFailed() will throw exceptions
Index: AssertionFailedError.cpp
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/AssertionFailedError.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- AssertionFailedError.cpp 30 Dec 2004 20:54:04 -0000 1.13
+++ AssertionFailedError.cpp 28 Aug 2005 20:40:23 -0000 1.14
@@ -50,6 +50,22 @@
}
+MOCKPP_EXPORT
+void assertionFailed(unsigned srcline, const String& srcfile,
+ const String &message)
+{
+ assertionFailed(srcline, getLatin1(srcfile).c_str(), message);
+}
+
+
+MOCKPP_EXPORT
+void assertionFailed(unsigned srcline, const char* srcfile,
+ const String &message)
+{
+ throw AssertionFailedError(srcline, srcfile, message);
+}
+
+
} // namespace mockpp
Index: Assert.cpp
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/Assert.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- Assert.cpp 2 Apr 2005 13:46:30 -0000 1.23
+++ Assert.cpp 28 Aug 2005 20:40:23 -0000 1.24
@@ -101,7 +101,7 @@
void MOCKPP_EXPORT fail(unsigned srcline, const char* srcfile,
const String &message)
{
- throw AssertionFailedError(srcline, srcfile, message);
+ assertionFailed(srcline, srcfile, message);
}
Index: Formatter.cpp
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/Formatter.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- Formatter.cpp 31 Jul 2005 14:14:08 -0000 1.42
+++ Formatter.cpp 28 Aug 2005 20:40:23 -0000 1.43
@@ -34,6 +34,7 @@
#include <cctype>
#include <mockpp/compat/Formatter.h>
+#include <mockpp/compat/Assert.h>
#include <mockpp/compat/AssertionFailedError.h>
@@ -49,7 +50,7 @@
{
mockpp::String fmt = mockpp_i18n( MOCKPP_PCHAR( "Conversion of long to String: base %1 not allowed" ) );
fmt << number( ( unsigned long ) base, 10 );
- throw mockpp::AssertionFailedError( __LINE__, __FILE__, fmt );
+ mockpp::assertionFailed( __LINE__, __FILE__, fmt );
}
mockpp::Char charbuf[ 65 * sizeof( mockpp::Char ) ];
@@ -106,7 +107,7 @@
{
mockpp::String fmt = mockpp_i18n( MOCKPP_PCHAR( "Conversion of ulong to String: base %1 not allowed" ) );
fmt << number( ( unsigned long ) base, 10 );
- throw mockpp::AssertionFailedError( __LINE__, __FILE__, fmt );
+ mockpp::assertionFailed( __LINE__, __FILE__, fmt );
}
mockpp::Char charbuf[ 65 * sizeof( mockpp::Char ) ];
@@ -195,7 +196,7 @@
int pos, len;
if ( !findArg(formatter, pos, len ) )
- throw Exception(__LINE__, __FILE__, MOCKPP_PCHAR("No %-placeholder found to insert \'")
+ fail(__LINE__, __FILE__, MOCKPP_PCHAR("No %-placeholder found to insert \'")
+ repdata
+ MOCKPP_PCHAR("\' into \'")
+ formatter
Index: AssertionFailedError.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/compat/AssertionFailedError.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- AssertionFailedError.h 30 Dec 2004 20:54:04 -0000 1.12
+++ AssertionFailedError.h 28 Aug 2005 20:40:23 -0000 1.13
@@ -59,6 +59,24 @@
};
+/** Throws an AssertionFailedError.
+ * @param srcline the line in the sourcefile
+ * @param srcfile the name of the sourcefile
+ * @param message a human readable description about the cause
+ */
+void assertionFailed(unsigned srcline, const char* srcfile,
+ const String &message);
+
+
+/** Throws an AssertionFailedError.
+ * @param srcline the line in the sourcefile
+ * @param srcfile the name of the sourcefile
+ * @param message a human readable description about the cause
+ */
+void assertionFailed(unsigned srcline, const String& srcfile,
+ const String &message);
+
+
} // namespace mockpp
|