[MOAB-dev] r3237 - MOAB/trunk/tools/iMesh

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Oct 20 18:27:57 CDT 2009


Author: kraftche
Date: 2009-10-20 18:27:56 -0500 (Tue, 20 Oct 2009)
New Revision: 3237

Modified:
   MOAB/trunk/tools/iMesh/testc_cbind.c
Log:
add regressesion test for bug found by Jim

Modified: MOAB/trunk/tools/iMesh/testc_cbind.c
===================================================================
--- MOAB/trunk/tools/iMesh/testc_cbind.c	2009-10-20 22:18:24 UTC (rev 3236)
+++ MOAB/trunk/tools/iMesh/testc_cbind.c	2009-10-20 23:27:56 UTC (rev 3237)
@@ -2065,6 +2065,39 @@
           && tag_delete_success);
 }
 
+int set_remove_contained_regression( iMesh_Instance mesh )
+{
+    int err,contained;
+    iBase_EntitySetHandle set,sub;
+
+    iMesh_createEntSet(mesh,0,&set,&err);
+    if (iBase_SUCCESS != err) return 0;
+    iMesh_createEntSet(mesh,1,&sub,&err);
+    if (iBase_SUCCESS != err) return 0;
+
+    iMesh_addEntSet(mesh,sub,set,&err);
+    if (iBase_SUCCESS != err) return 0;
+
+    iMesh_isEntSetContained(mesh,set,sub,&contained,&err);
+    if (iBase_SUCCESS != err) return 0;
+    if (!contained) {
+      fprintf(stderr,"isEntSetContained returned false for contained set\n");
+      return 0;
+    }
+
+    iMesh_rmvEntSet(mesh,sub,set,&err);
+    if (iBase_SUCCESS != err) return 0;
+
+    iMesh_isEntSetContained(mesh,set,sub,&contained,&err);
+    if (iBase_SUCCESS != err) return 0;
+    if (contained) {
+      fprintf(stderr,"isEntSetContained returned true for removed set\n");
+      return 0;
+    }
+    
+    return 1;
+}
+
 int main( int argc, char *argv[] )
 {
     /* Check command line arg */
@@ -2184,6 +2217,15 @@
   number_tests++;
   printf("\n");
 
+    /* regression test for remove/contained bug */
+  printf("   set_remove_contained_regression: ");
+  result = set_remove_contained_regression(mesh);
+  handle_error_code(result, &number_tests_failed,
+                    &number_tests_not_implemented,
+                    &number_tests_successful);
+  number_tests++;
+  printf("\n");
+
     /* summary */
 
   printf("\nTSTT TEST SUMMARY: \n");



More information about the moab-dev mailing list