[MOAB-dev] r4115 - in MOAB/trunk/test: . io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Aug 31 17:51:57 CDT 2010


Author: kraftche
Date: 2010-08-31 17:51:57 -0500 (Tue, 31 Aug 2010)
New Revision: 4115

Modified:
   MOAB/trunk/test/MBTest.cpp
   MOAB/trunk/test/io/exodus_test.cc
Log:
Work towards removing dependency on NetCDF for MBTest:

o Change test function signature to accept no arguments
o Add new create_some_mesh() utility function 
o Change some tests that loaded mbtest1.g to use create_some_mesh instead
o Move some tests that were highly dependent on exodus to exodus_test.cc
   (e.g. check that the 5th hex read from file has connectivity {1,3,4,...})

The following tests still need to be updated to work w/out reading an 
ExodusII file:
- mb_adjacencies_test
- mb_delete_mesh_test
- mb_meshset_tracking_test
- mb_tags_test
- mb_entity_conversion_test
- mb_merge_test
- mb_stress_test


Modified: MOAB/trunk/test/MBTest.cpp
===================================================================
--- MOAB/trunk/test/MBTest.cpp	2010-08-31 16:26:54 UTC (rev 4114)
+++ MOAB/trunk/test/MBTest.cpp	2010-08-31 22:51:57 UTC (rev 4115)
@@ -79,6 +79,23 @@
             std::cerr << "Test failed at " __FILE__ ":" << __LINE__ << std::endl; \
             return MB_FAILURE; } } while(false)
 
+
+ErrorCode load_file_one( Interface* iface )
+{
+  std::string file_name = TestDir + "/mbtest1.g";
+  ErrorCode error = iface->load_mesh( file_name.c_str() );
+  if (MB_SUCCESS != error) {
+    std::cout << "Failed to load input file: " << file_name << std::endl;
+    std::string error_reason;
+    iface->get_last_error(error_reason);
+    cout << error_reason << std::endl;
+  }
+  return error;
+}
+
+/* Create a regular 2x2x2 hex mesh */
+ErrorCode create_some_mesh( Interface* iface );
+
   /*!
     @test 
     Vertex Coordinates
@@ -86,107 +103,55 @@
     @li Get coordinates of vertex 8 correctly
     @li Get coordinates of vertex 6 correctly
   */
-
-ErrorCode mb_vertex_coordinate_test(Interface *MB)
+ErrorCode mb_vertex_coordinate_test()
 {
-  double coords[3];
-  EntityHandle handle;
-  ErrorCode error;
-  int err;
+  Core moab;
+  Interface* MB = &moab;
+  ErrorCode error = create_some_mesh( MB );
+  CHKERR(error);
 
-    // coordinate 2 should be {1.5, -1.5, 3.5}
-
-  handle = CREATE_HANDLE(MBVERTEX, 2, err);
-  error = MB->get_coords(&handle, 1, coords );
-  if (error != MB_SUCCESS)
-    return error;


More information about the moab-dev mailing list