[MOAB-dev] [PATCH] scdtest.cpp: print what failed on error

Jed Brown jed at 59A2.org
Thu Nov 26 06:09:50 CST 2009


---
 parallel/scdtest.cpp |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/parallel/scdtest.cpp b/parallel/scdtest.cpp
index 64ca4d8..4158ff2 100644
--- a/parallel/scdtest.cpp
+++ b/parallel/scdtest.cpp
@@ -42,6 +42,14 @@ void create_hexes_and_verts();
 void resolve_and_exchange();
 void error(MBErrorCode err);
 
+#define error(err) do {                         \
+    if((err) != MB_SUCCESS) {                   \
+      cerr << "Error: MOAB function failed\n";  \
+      assert((err) == MB_SUCCESS);              \
+    }                                           \
+  } while (0)
+
+
 int main(int argc, char *argv[])
 {
   MPI_Init(&argc, &argv);
@@ -196,10 +204,3 @@ void resolve_and_exchange()
   error(mbpc->exchange_ghost_cells(-1, 0, 1, true));
 }
 
-void error(MBErrorCode err)
-{
-  if(err != MB_SUCCESS) {
-    cerr << "Error: MOAB function failed\n";
-    assert(0);
-  }
-}
-- 
1.6.5.3



More information about the moab-dev mailing list