[MOAB-dev] r4550 - in MOAB/trunk: src/io test/h5file

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Mar 8 12:58:03 CST 2011


Author: kraftche
Date: 2011-03-08 12:58:02 -0600 (Tue, 08 Mar 2011)
New Revision: 4550

Modified:
   MOAB/trunk/src/io/WriteHDF5.cpp
   MOAB/trunk/test/h5file/h5sets_test.cpp
Log:
fix another bug introduced in r4532 in writing set data to .h5m file

Modified: MOAB/trunk/src/io/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/WriteHDF5.cpp	2011-03-08 16:47:22 UTC (rev 4549)
+++ MOAB/trunk/src/io/WriteHDF5.cpp	2011-03-08 18:58:02 UTC (rev 4550)
@@ -1132,14 +1132,15 @@
     if (!remaining.empty()) {
       count = remaining.size() - remaining_offset;
       if (count > buffer_size) {
+        memcpy( buffer, &remaining[remaining_offset], buffer_size*sizeof(id_t) );
         count = buffer_size;
-        remaining_offset += count;
+        remaining_offset += buffer_size;
       }
       else {
+        memcpy( buffer, &remaining[remaining_offset], count*sizeof(id_t) );
         remaining_offset = 0;
         remaining.clear();
       }
-      memcpy( buffer, &remaining[remaining_offset], count*sizeof(id_t) );
     }
       // If we had some left-over data from a non-range-compacted set
       // from the last iteration, add it to the buffer now

Modified: MOAB/trunk/test/h5file/h5sets_test.cpp
===================================================================
--- MOAB/trunk/test/h5file/h5sets_test.cpp	2011-03-08 16:47:22 UTC (rev 4549)
+++ MOAB/trunk/test/h5file/h5sets_test.cpp	2011-03-08 18:58:02 UTC (rev 4550)
@@ -293,7 +293,7 @@
 
 void test_small_tree() 
 { 
-  int max_depth = 5;
+  int max_depth = 8;
   const char* str = getenv("MAX_DEPTH");
   if (str) {
     max_depth = atoi(str);
@@ -322,8 +322,6 @@
     }
   }
 
-  // only one test so far... should probably add second test
-  // for really-old-format  entityset parent/child links
   int exitval = 0;
   exitval += RUN_TEST( test_ranged_set_with_holes );
   exitval += RUN_TEST( test_file_set );








More information about the moab-dev mailing list