[MOAB-dev] r5007 - MOAB/trunk/test

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Jun 15 10:06:53 CDT 2011


Author: kraftche
Date: 2011-06-15 10:06:52 -0500 (Wed, 15 Jun 2011)
New Revision: 5007

Modified:
   MOAB/trunk/test/MBTest.cpp
Log:
add some test code that reproduces the error case Iulian found and fixed

Modified: MOAB/trunk/test/MBTest.cpp
===================================================================
--- MOAB/trunk/test/MBTest.cpp	2011-06-15 15:04:57 UTC (rev 5006)
+++ MOAB/trunk/test/MBTest.cpp	2011-06-15 15:06:52 UTC (rev 5007)
@@ -43,6 +43,7 @@
 #include "moab/CN.hpp"
 #include "OrientedBox.hpp"
 #include "moab/CartVect.hpp"
+#include "moab/WriteUtilIface.hpp"
 
 #ifndef IS_BUILDING_MB
 #define IS_BUILDING_MB
@@ -2489,7 +2490,7 @@
 }
 
 
-ErrorCode mb_meshset_tracking_test()
+ErrorCode mb_mesh_set_tracking_test()
 {
   Core moab;
   Interface* MB = &moab;
@@ -2701,6 +2702,220 @@
 }
 
 
+// Compare internal representation of contents for a list (MESHSET_ORDERED)
+// set to expected contents.  Assumes expected contents are correctly
+// ordered.
+static ErrorCode check_list_meshset_internal( Interface& mb,
+                                              const EntityHandle* expected,
+                                              int num_expected,
+                                              const EntityHandle* contents,
+                                              int length )
+{
+  bool okay = true;
+  for (int i = 0; i < std::min(num_expected, length); ++i) {
+    if (expected[i] != contents[i]) {
+      std::cerr << "List set contents differ at index " << i 
+                << ": expected " << expected[i] << " but got " 
+                << contents[i] << std::endl;
+      okay = false;
+    }
+  }
+  if (num_expected > length) {
+    std::cerr << "List set is missing " << num_expected - length << 
+                 "handles" << std::endl;
+    okay = false;
+  }
+  else if (length > num_expected) {
+    std::cerr << "List set has " << num_expected - length << 
+                 " extra handles" << std::endl;


More information about the moab-dev mailing list