tng 2002/11/12 09:51:48
Modified: c/tests/DOM/DOMMemTest DOMMemTest.cpp
Log:
Test update: do not issue "Test Run Successfully" if there was an error.
Revision Changes Path
1.41 +23 -9 xml-xerces/c/tests/DOM/DOMMemTest/DOMMemTest.cpp
Index: DOMMemTest.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tests/DOM/DOMMemTest/DOMMemTest.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- DOMMemTest.cpp 5 Nov 2002 21:47:35 -0000 1.40
+++ DOMMemTest.cpp 12 Nov 2002 17:51:48 -0000 1.41
@@ -74,12 +74,16 @@
XERCES_CPP_NAMESPACE_USE
+bool errorOccurred = false;
+
#define TASSERT(c) tassert((c), __FILE__, __LINE__)
void tassert(bool c, const char *file, int line)
{
- if (!c)
+ if (!c) {
printf("Failure. Line %d, file %s\n", line, file);
+ errorOccurred = true;
+ }
};
@@ -88,14 +92,18 @@
try { \
operation; \
printf(" Error: no exception thrown at line %d\n", __LINE__); \
-} \
- catch (DOMException &e) { \
- if (e.code != expected_exception) \
- printf(" Wrong exception code: %d at line %d\n", e.code, __LINE__); \
-} \
+ errorOccurred = true; \
+ } \
+ catch (DOMException &e) { \
+ if (e.code != expected_exception) { \
+ printf(" Wrong exception code: %d at line %d\n", e.code, __LINE__); \
+ errorOccurred = true; \
+ } \
+ } \
catch (...) { \
- printf(" Wrong exception thrown at line %d\n", __LINE__); \
-} \
+ printf(" Wrong exception thrown at line %d\n", __LINE__); \
+ errorOccurred = true; \
+ } \
}
// ---------------------------------------------------------------------------
@@ -1505,7 +1513,13 @@
for (int i = 0; i<3; i++)
mymain();
+ if (errorOccurred) {
+ printf("Test Failed\n");
+ return 4;
+ }
+
printf("Test Run Successfully\n");
+
return 0;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]