[MOAB-dev] commit/MOAB: danwu: Update TestErrorHandling example, as the error handler now uses ErrorOutput class to print error messages and stack traces.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jan 29 17:08:45 CST 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/264ee8346d42/
Changeset: 264ee8346d42
Branch: error_handling_enhancement
User: danwu
Date: 2014-01-30 00:08:30
Summary: Update TestErrorHandling example, as the error handler now uses ErrorOutput class to print error messages and stack traces.
Affected #: 1 file
diff --git a/examples/TestErrorHandling.cpp b/examples/TestErrorHandling.cpp
index 3108b99..ba97767 100644
--- a/examples/TestErrorHandling.cpp
+++ b/examples/TestErrorHandling.cpp
@@ -20,12 +20,12 @@ ErrorInfo FunctionC(int n)
}
else if (2 == n) {
// Simulate MB_FILE_WRITE_ERROR
- SET_ERR1(MB_FILE_WRITE_ERROR, "FunctionC created a contrived error MB_ENTITY_MB_FILE_WRITE_ERROR.");
+ SET_ERR1(MB_FILE_WRITE_ERROR, "FunctionC created a contrived error MB_ENTITY_MB_FILE_WRITE_ERROR");
}
else if (3 == n) {
// Simulate MB_NOT_IMPLEMENTED
ErrorInfo err_info(MB_NOT_IMPLEMENTED);
- err_info << "n = " << n << ", FunctionC created a contrived MB_NOT_IMPLEMENTED (this message is built with C++ streaming).";
+ err_info << "n = " << n << ", FunctionC created a contrived MB_NOT_IMPLEMENTED (this message is built with C++ streaming)";
SET_ERR(err_info);
}
@@ -73,6 +73,8 @@ ErrorInfo Test_3()
int main()
{
+ MBErrorHandler_Init();
+
cout << "--------------------Running test case 1 start--------------------" << endl;
Test_1();
cout << "--------------------Running test case 1 end----------------------\n" << endl;
@@ -85,5 +87,7 @@ int main()
Test_3();
cout << "--------------------Running test case 3 end----------------------\n" << endl;
+ MBErrorHandler_Finalize();
+
return 0;
}
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list