[MOAB-dev] commit/MOAB: danwu: Fix some more compile warnings from unit tests.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Sep 6 14:52:18 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/234e05425e5f/
Changeset:   234e05425e5f
Branch:      master
User:        danwu
Date:        2013-09-06 21:52:07
Summary:     Fix some more compile warnings from unit tests.

Affected #:  4 files

diff --git a/test/io/read_cgm_test.cpp b/test/io/read_cgm_test.cpp
index c7fa27d..5377220 100644
--- a/test/io/read_cgm_test.cpp
+++ b/test/io/read_cgm_test.cpp
@@ -41,7 +41,7 @@ void read_multiple_test()
 
 }
   
-int main(int argc, char* argv[])
+int main(int /* argc */, char** /* argv */)
 {
   int result = RUN_TEST( read_multiple_test );
 

diff --git a/test/parallel/parallel_hdf5_test.cc b/test/parallel/parallel_hdf5_test.cc
index 355e99e..11224f2 100644
--- a/test/parallel/parallel_hdf5_test.cc
+++ b/test/parallel/parallel_hdf5_test.cc
@@ -724,21 +724,21 @@ void test_var_length_parallel()
     const void* ptrarr[1] = { 0 };
     rval = mb.tag_get_by_ptr( vartag, &h, 1, ptrarr, &size );
     CHECK_ERR( rval );
-    const int* data = reinterpret_cast<const int*>(ptrarr[0]);
+    const int* tag_data = reinterpret_cast<const int*>(ptrarr[0]);
     CHECK( size >= 2 );
-    CHECK( NULL != data );
-    CHECK_EQUAL( size-1, data[0] );
-    CHECK( data[1] >= 0 && data[1] < numproc );
-    ++vtx_counts[data[1]];
-    for (int j = 1; j < size-1; ++j)
-      CHECK_EQUAL( data[1]+j, data[1+j] );
+    CHECK( NULL != tag_data );
+    CHECK_EQUAL( size - 1, tag_data[0] );
+    CHECK( tag_data[1] >= 0 && tag_data[1] < numproc );
+    ++vtx_counts[tag_data[1]];
+    for (int j = 1; j < size - 1; ++j)
+      CHECK_EQUAL( tag_data[1] + j, tag_data[1 + j] );
   }
   
   // Check number of vertices for each rank
   for (int j = 0; j < numproc; ++j) {
     // Only root should have data for other processors.
     if (rank == 0 || rank == j) 
-      CHECK_EQUAL( j+1, vtx_counts[j] );
+      CHECK_EQUAL( j + 1, vtx_counts[j] );
     else 
       CHECK_EQUAL( 0, vtx_counts[j] );
   }
@@ -900,7 +900,7 @@ void create_input_file( const char* file_name,
   CHECK_ERR(rval);
 }
 
-void test_read_elements_common( bool by_rank, int intervals, bool print_time,
+void test_read_elements_common( bool by_rank, int intervals, bool /* print_time */,
                                 const char* extra_opts )
 {
   const char *file_name = by_rank ? "test_read_rank.h5m" : "test_read.h5m";
@@ -1204,7 +1204,7 @@ void test_read_sets_common( const char* extra_opts )
 
 void test_read_bc_sets()
 {
-  const char tag_name[] = "test_tag_s";
+  //const char tag_name[] = "test_tag_s";
   const char file_name[] = "test_read_sets.h5m";
   int numproc, rank;
   MPI_Comm_size( MPI_COMM_WORLD, &numproc );
@@ -1417,23 +1417,23 @@ void test_write_polygons()
   std::vector<EntityHandle> poly( numproc, 0 );
   CHECK_EQUAL( numproc, (int)range.size() );
   for (Range::iterator it = range.begin(); it != range.end(); ++it) {
-    const EntityHandle* conn;
+    const EntityHandle* conn_arr;
     int len;
-    rval = mb.get_connectivity( *it, conn, len );
+    rval = mb.get_connectivity( *it, conn_arr, len );
     CHECK_ERR(rval);
     double coords[3];
-    rval = mb.get_coords( conn, 1, coords );
+    rval = mb.get_coords( conn_arr, 1, coords );
     CHECK_ERR(rval);
-    int r = (int)(coords[2]);
-    CHECK_EQUAL( (EntityHandle)0, poly[r] );
-    poly[r] = *it;
+    int proc = (int)(coords[2]);
+    CHECK_EQUAL( (EntityHandle)0, poly[proc] );
+    poly[proc] = *it;
   }
   
     // check that each poly has the expected number of vertices
   for (int i = 0; i < numproc; ++i) {
-    const EntityHandle* conn;
+    const EntityHandle* conn_arr;
     int len;
-    rval = mb.get_connectivity( poly[i], conn, len );
+    rval = mb.get_connectivity( poly[i], conn_arr, len );
     CHECK_ERR(rval);
     CHECK_EQUAL( i % 4 + 5, len );
   }

diff --git a/test/parallel/parallel_unit_tests.cpp b/test/parallel/parallel_unit_tests.cpp
index 7d47a4c..864ebae 100644
--- a/test/parallel/parallel_unit_tests.cpp
+++ b/test/parallel/parallel_unit_tests.cpp
@@ -1407,15 +1407,15 @@ ErrorCode test_shared_sets( const char* )
       continue;
     }
     
-    Range expected;
+    Range expected_range;
     for (size_t j = 0; j < 3; ++j)
       if (set_owners[j] == i)
-        expected.insert( set_arr[j] );
+        expected_range.insert( set_arr[j] );
     
-    if (expected != sets) {
+    if (expected_range != sets) {
       std::cerr << __FILE__ << ":" << __LINE__ << " rank " << rank 
                 << " has incorrect shared set list for sets owned by rank " 
-                << set_owners[i] << std::endl << "Expected: " << expected << std::endl
+                << set_owners[i] << std::endl << "Expected: " << expected_range << std::endl
                 << "Actual: " << sets << std::endl;
       ok = MB_FAILURE;
     }

diff --git a/test/parallel/parmerge.cpp b/test/parallel/parmerge.cpp
index f29445d..452acfc 100644
--- a/test/parallel/parmerge.cpp
+++ b/test/parallel/parmerge.cpp
@@ -144,7 +144,7 @@ int main(int argc, char * argv[])
 //This function doesn't normally get called, but is here for debugging
 //and verifying that merge is working.  
 void print_output(moab::ParallelComm *pc, moab::Core *mb,
-                  int myID, int numprocs, bool perform){
+                  int myID, int /* numprocs */, bool perform){
   moab::Range ents, skin;
   int o_ct=0, no_ct=0, tmp=0, o_tot=0, no_tot=0;
   if(perform){

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list