From c104175ba8626732c97e74c2365fcbfb39c01ea4 Mon Sep 17 00:00:00 2001
From: Jochem Snuverink <jochem.snuverink@psi.ch>
Date: Wed, 18 Mar 2020 21:09:57 +0100
Subject: [PATCH] Resolve "clang compiler warnings in unit tests"

---
 ippl/src/Utility/ParticleDebug.hpp           | 157 +++++++++----------
 tests/ippl_src/Field/DataConnect.cpp         |   2 -
 tests/ippl_src/Field/FieldDebug.cpp          |   2 -
 tests/ippl_src/Meshes/Cartesian.cpp          |  63 ++++----
 tests/ippl_src/Meshes/CartesianCentering.cpp |   2 +-
 tests/opal_test_utilities/Maxwell.cpp        |   6 +-
 tests/opal_test_utilities/Maxwell.h          |   6 +-
 7 files changed, 113 insertions(+), 125 deletions(-)

diff --git a/ippl/src/Utility/ParticleDebug.hpp b/ippl/src/Utility/ParticleDebug.hpp
index bf08f3cd5..8ff8318f5 100644
--- a/ippl/src/Utility/ParticleDebug.hpp
+++ b/ippl/src/Utility/ParticleDebug.hpp
@@ -2,8 +2,8 @@
 /***************************************************************************
  *
  * The IPPL Framework
- * 
- * This program was prepared by PSI. 
+ *
+ * This program was prepared by PSI.
  * All rights in the program are reserved by PSI.
  * Neither PSI nor the author(s)
  * makes any warranty, express or implied, or assumes any liability or
@@ -40,8 +40,7 @@
 //----------------------------------------------------------------------
 template<class T>
 void pap(ParticleAttrib<T>& pattr, bool docomm) {
-  
-  
+
   // Set Inform ptr if not set:
   if (!PtclDbgInformIsSet) {
     if (!FldDbgInformIsSet) {
@@ -61,12 +60,12 @@ void pap(ParticleAttrib<T>& pattr, bool docomm) {
     int tag2 = Ippl::Comm->next_tag(IPPL_APP_TAG0, IPPL_APP_CYCLE);
     Message *msg, *msg2;
     if (mype == 0) {
-      int otherNumPtcles;
+      int otherNumPtcles = 0;
       for (int pe = 1; pe < npes; pe++) {
-	msg = IpplInfo::Comm->receive_block(pe, tag);
-	msg->get(otherNumPtcles);
+        msg = IpplInfo::Comm->receive_block(pe, tag);
+        msg->get(otherNumPtcles);
         delete msg;
-	numPtcles += otherNumPtcles;
+        numPtcles += otherNumPtcles;
       }
       msg2 = new Message;
       msg2->put(numPtcles);
@@ -83,10 +82,10 @@ void pap(ParticleAttrib<T>& pattr, bool docomm) {
     }
     IpplInfo::Comm->barrier();
     spap(pattr, 0, numPtcles - 1, 1, docomm);
-    
+
   }
   else {
-      
+
     spap(pattr, 0, pattr.size() - 1, 1, docomm);
 
   }
@@ -97,8 +96,8 @@ void pap(ParticleAttrib<T>& pattr, bool docomm) {
 //----------------------------------------------------------------------
 template<class T>
 void epap(ParticleAttrib<T>& pattr, int i, bool docomm) {
-  
-  
+
+
   // Set Inform ptr if not set:
   if (!PtclDbgInformIsSet) {
     if (!FldDbgInformIsSet) {
@@ -115,10 +114,10 @@ void epap(ParticleAttrib<T>& pattr, int i, bool docomm) {
 // Print a strided subrange of a ParticleAttrib
 //----------------------------------------------------------------------
 template<class T>
-void spap(ParticleAttrib<T>& pattr, 
-	  int ibase, int ibound, int istride, bool docomm) {
-  
-  
+void spap(ParticleAttrib<T>& pattr,
+          int ibase, int ibound, int istride, bool docomm) {
+
+
 
   // Set Inform ptr if not set:
   if (!PtclDbgInformIsSet) {
@@ -134,35 +133,35 @@ void spap(ParticleAttrib<T>& pattr,
   bool okParameters = true;
   if (ibase < -1) {
     (*PtclDbgInform) << "spap() error: ibase (= " << ibase
-		    << ") < lowest index value (= " << 0 << ")" << endl;
+                    << ") < lowest index value (= " << 0 << ")" << endl;
     okParameters = false;
   }
   //tjw??? Can't check if i greater than total num ptcles, because this number
   //isn't available in ParticleAttrib
   if (istride < 0) {
-    (*PtclDbgInform) << "spap() error: istride < 0 not implemented yet." 
-		     << endl;
+    (*PtclDbgInform) << "spap() error: istride < 0 not implemented yet."
+                     << endl;
     okParameters = false;
   }
   else {
     if ((ibound < ibase) && !((ibase == 0) && (ibound == -1))) {
       (*PtclDbgInform) << "spap() error: ibase (= " << ibase
-		       << ") > ibound (=  " << ibound 
-		       << ") not implemented yet." << endl;
+                       << ") > ibound (=  " << ibound
+                       << ") not implemented yet." << endl;
       okParameters = false;
     }
   }
   if (istride == 0) {
     if (((ibound - ibase) != 0) && !((ibase == 0) && (ibound == -1))) {
-      (*PtclDbgInform) << "spap() error: istride = 0 but (ibound - ibase) = " 
-		       << (ibound - ibase) << endl;
+      (*PtclDbgInform) << "spap() error: istride = 0 but (ibound - ibase) = "
+                       << (ibound - ibase) << endl;
       okParameters = false;
     }
     else {
-      istride = 1; // Allow specifying stride 0 for 1-element range; set=1 
+      istride = 1; // Allow specifying stride 0 for 1-element range; set=1
     }
   }
-  
+
   if (!okParameters) return; // Exit if problem with input parameters
 
   if (docomm) {
@@ -181,12 +180,12 @@ void spap(ParticleAttrib<T>& pattr,
     int tag2 = Ippl::Comm->next_tag(IPPL_APP_TAG0, IPPL_APP_CYCLE);
     Message *msg, *msg2;
     if (mype == 0) {
-      int otherNumPtcles;
+      int otherNumPtcles = 0;
       for (int pe=1; pe<npes; pe++) {
-	msg = IpplInfo::Comm->receive_block(pe, tag);
-	msg->get(otherNumPtcles);
+        msg = IpplInfo::Comm->receive_block(pe, tag);
+        msg->get(otherNumPtcles);
         delete msg;
-	numsPtcles[pe] = numsPtcles[pe - 1] + otherNumPtcles;
+        numsPtcles[pe] = numsPtcles[pe - 1] + otherNumPtcles;
       }
       msg2 = new Message;
       msg2->putmsg((void *)numsPtcles, sizeof(int), npes);
@@ -216,39 +215,39 @@ void spap(ParticleAttrib<T>& pattr,
     Index requestedRange(ibase, ibound, istride);
     for (int pe=0; pe < npes; pe++) {
       if (mype == pe) {
-	if (myNumPtcles > 0) {
-	  if (myRange.touches(requestedRange)) {
-	    Index myRequestedRange = requestedRange.intersect(myRange);
-	    int mybase = myRequestedRange.first();
-	    int mybound = myRequestedRange.last();
-	    *PtclDbgInform << "....PE = " << mype 
-			  << " GLOBAL ptcle index subrange (" << mybase
-			  << " : " << mybound << " : " << istride 
-			  << ")...." << endl;
-	    for (int p = mybase; p <= mybound; p += istride*elementsPerLine) {
-	      for (int item = 0; ((item < elementsPerLine) &&
-				  ((p+item*istride) <= mybound)); item++) {
-// 				  (item < mylength)); item++) {
-		*PtclDbgInform << std::setprecision(digitsPastDecimal) 
-			       << std::setw(widthOfElements)
-			       << pattr[p + item*istride] << " ";
-	      }
+        if (myNumPtcles > 0) {
+          if (myRange.touches(requestedRange)) {
+            Index myRequestedRange = requestedRange.intersect(myRange);
+            int mybase = myRequestedRange.first();
+            int mybound = myRequestedRange.last();
+            *PtclDbgInform << "....PE = " << mype
+                          << " GLOBAL ptcle index subrange (" << mybase
+                          << " : " << mybound << " : " << istride
+                          << ")...." << endl;
+            for (int p = mybase; p <= mybound; p += istride*elementsPerLine) {
+              for (int item = 0; ((item < elementsPerLine) &&
+                                  ((p+item*istride) <= mybound)); item++) {
+//                                (item < mylength)); item++) {
+                *PtclDbgInform << std::setprecision(digitsPastDecimal)
+                               << std::setw(widthOfElements)
+                               << pattr[p + item*istride] << " ";
+              }
 
-	      *PtclDbgInform << endl;
-	    }
-	  }	    
-	}
+              *PtclDbgInform << endl;
+            }
+          }
+        }
         else {
-	  //don't	  *PtclDbgInform << "....PE = " << mype 
-	  //don't			<< " has no particles ...." << endl;
-	}
+          //don't         *PtclDbgInform << "....PE = " << mype
+          //don't			<< " has no particles ...." << endl;
+        }
       }
       IpplInfo::Comm->barrier();
     }
     if (mype == 0) *PtclDbgInform << endl;
     delete [] numsPtcles;
   }
-  else { 
+  else {
 
     // No communication; assume calling pe(s) print data for their particle
     // data values having LOCAL index range (ibase,ibound,istride):
@@ -256,45 +255,35 @@ void spap(ParticleAttrib<T>& pattr,
     int myNumPtcles = pattr.size();
     if (PtclDbgInform->getPrintNode() != INFORM_ALL_NODES) {
       WARNMSG(endl << "spap(): Currently, if docomm=false you must specify "
-	      << "an Inform object having INFORM_ALL_NODES as its "
-	      << "printing-node specifier if you want to see output from "
-	      << "any processor calling [e,s]pap(); the Inform object "
-	      << "you're trying to use has " 
-	      << PtclDbgInform->getPrintNode() << " specified. " 
-	      << "N.B.: If you called setInform() and didn't also call "
-	      << "setPtclDbgInform() you are getting the FldDbgInform object "
-	      << "you set with setInform, which you may not have constructed "
-	      << "with INFORM_ALL_NODES." << endl << endl);
+              << "an Inform object having INFORM_ALL_NODES as its "
+              << "printing-node specifier if you want to see output from "
+              << "any processor calling [e,s]pap(); the Inform object "
+              << "you're trying to use has "
+              << PtclDbgInform->getPrintNode() << " specified. "
+              << "N.B.: If you called setInform() and didn't also call "
+              << "setPtclDbgInform() you are getting the FldDbgInform object "
+              << "you set with setInform, which you may not have constructed "
+              << "with INFORM_ALL_NODES." << endl << endl);
     }
 
     if (myNumPtcles > 0) {
-      *PtclDbgInform << "....PE = " << mype 
-		    << " LOCAL ptcle index range (" << ibase
-		    << " : " << ibound << " : " << istride << ")...." << endl;
+      *PtclDbgInform << "....PE = " << mype
+                    << " LOCAL ptcle index range (" << ibase
+                    << " : " << ibound << " : " << istride << ")...." << endl;
       int length = (ibound - ibase)/istride + 1;
       for (int p = ibase; p <= ibound; p += istride*elementsPerLine) {
-	for (int item = 0; ((item < elementsPerLine) &&
-			    (item < length)); item++) {
-	  *PtclDbgInform << std::setprecision(digitsPastDecimal) 
+        for (int item = 0; ((item < elementsPerLine) &&
+                            (item < length)); item++) {
+          *PtclDbgInform << std::setprecision(digitsPastDecimal)
                          << pattr[p + item*istride] << " ";
-	}
-	*PtclDbgInform << endl;
+        }
+        *PtclDbgInform << endl;
       }
       *PtclDbgInform << endl;
     } else {
-      *PtclDbgInform << "....PE = " << mype 
-		    << " has no particles ...." << endl;
+      *PtclDbgInform << "....PE = " << mype
+                    << " has no particles ...." << endl;
     }
 
   }
-
-}
-
-// $Id: ParticleDebug.cpp,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
-
-/***************************************************************************
- * $RCSfile: addheaderfooter,v $   $Author: adelmann $
- * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:17 $
- * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ 
- ***************************************************************************/
-
+}
\ No newline at end of file
diff --git a/tests/ippl_src/Field/DataConnect.cpp b/tests/ippl_src/Field/DataConnect.cpp
index 26807c7e1..d0dc006df 100644
--- a/tests/ippl_src/Field/DataConnect.cpp
+++ b/tests/ippl_src/Field/DataConnect.cpp
@@ -10,8 +10,6 @@
 
 #include <iostream>
 
-constexpr double roundOffError = 1e-10;
-
 TEST(Field, DataConnect2D)
 {
     OpalTestUtilities::SilenceTest silencer;
diff --git a/tests/ippl_src/Field/FieldDebug.cpp b/tests/ippl_src/Field/FieldDebug.cpp
index c6a753707..a4febeb03 100644
--- a/tests/ippl_src/Field/FieldDebug.cpp
+++ b/tests/ippl_src/Field/FieldDebug.cpp
@@ -15,8 +15,6 @@ namespace {
     bool thediff(std::string filename1, std::string filename2);
 }
 
-constexpr double roundOffError = 1e-10;
-
 TEST(Field, FieldDebug)
 {
     bool docomm = true; // Should try the test both ways, really....
diff --git a/tests/ippl_src/Meshes/Cartesian.cpp b/tests/ippl_src/Meshes/Cartesian.cpp
index 5ff8025bf..036438bd2 100644
--- a/tests/ippl_src/Meshes/Cartesian.cpp
+++ b/tests/ippl_src/Meshes/Cartesian.cpp
@@ -19,17 +19,17 @@ TEST(Meshes, Cartesian)
 
     // Sizes:
     unsigned nverts[D], ncells[D];
-    unsigned totverts, totcells=1;
+    unsigned totverts = 1, totcells = 1;
     unsigned int d;
 
-    for (d=0; d<D; d++) {
+    for (d = 0; d < D; d++) {
         ncells[d] = nv - 1;
         nverts[d] = nv;
         totcells *= ncells[d];
         totverts *= nverts[d];
     }
     NDIndex<D> verts, cells;
-    for (d=0; d<D; d++) {
+    for (d = 0; d < D; d++) {
         verts[d] = Index(nverts[d]);
         cells[d] = Index(ncells[d]);
     }
@@ -42,24 +42,24 @@ TEST(Meshes, Cartesian)
 
     double* delX[D];
 
-    for (d=0; d<D; d++)
+    for (d = 0; d < D; d++)
         delX[d] = new double[nverts[d]];
 
     Vektor<double,D> origin;
-    for (d=0; d<D; d++)
+    for (d = 0; d < D; d++)
         origin(d) = d + 1.0;
 
     // Assign nonuniform mesh-spacing values to each component (linear ramps):
-    for (d=0; d<D; d++) {
+    for (d = 0; d < D; d++) {
         double multipplier = (d + 1)*1.0;
-        for (unsigned int vert=0; vert < nverts[d]; vert++) {
+        for (unsigned int vert = 0; vert < nverts[d]; vert++) {
             (delX[d])[vert] = multipplier*(1 + vert);
         }
     }
 
     // Mesh boundary conditions:
     MeshBC_E mbc[2*D];
-    for (unsigned b=0; b < (2*D); b++)
+    for (unsigned b = 0; b < (2*D); b++)
         mbc[b] = Reflective;
 
     // Test constructing mesh, and then setting spacing, origin, BC's
@@ -69,7 +69,7 @@ TEST(Meshes, Cartesian)
     mesh.set_MeshBC(mbc);
 
     // Clean up mesh spacing arrays
-    for (d=0; d<D; d++)
+    for (d = 0; d < D; d++)
         delete [] delX[d];
 
     // ada have to cross check Div() fails without this
@@ -77,8 +77,7 @@ TEST(Meshes, Cartesian)
 
     // Construct CenteredFieldLayout's using this for Vert and Cell centering:
     e_dim_tag edt[D];
-    for (d=0; d<D; d++)
-        edt[d] = PARALLEL;
+    for (d = 0; d < D; d++) edt[d] = PARALLEL;
     CenteredFieldLayout<D,M,Cell> cl(mesh, edt, vnodes);
     CenteredFieldLayout<D,M,Vert> vl(mesh, edt, vnodes);
 
@@ -99,7 +98,7 @@ TEST(Meshes, Cartesian)
     BConds<Tenzor<double,D>,D,M,Cell> tcbc;
 
     // Use linear negative reflecting conditions:
-    for (unsigned int face=0; face<2*D; face++) {
+    for (unsigned int face = 0; face < 2*D; face++) {
         vvbc[face]  = new NegReflectFace<Vektor<double,D>,D,M,Vert>(face);
         vcbc[face]  = new NegReflectFace<Vektor<double,D>,D,M,Cell>(face);
         scbc[face]  = new NegReflectFace<double,D,M,Cell>(face);
@@ -134,30 +133,32 @@ TEST(Meshes, Cartesian)
     // Assign positive-sloping linear ramp values into the cell-centered
     // Field<scalar>:
     scalarCell = 0.0;
-    for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d);
+    for (d = 0; d < D; d++) scalarCell[cells] += vectorCell[cells](d);
     // Now take the gradient:
     vectorVert = Grad(scalarCell, vectorVert);
     // The value should be (1.0,1.0,1.0) for all elements one at least one
     // removed from the last-physical-layer elements. Last-physical-layer
     // elements will be different because the BC available in IPPL don't really
     // do the kind of linear extrapolation appropriate for the needs here:
-    Vektor<double,D> unit; for (d=0; d<D; d++) unit[d] = 1.0;
+    Vektor<double,D> unit;
+    for (d = 0; d < D; d++) unit[d] = 1.0;
     Vektor<double,D> sumVectorVert;
     // Use temporary, smaller BareField as a reduced-by-two vector Field to hold
     // only the boundary-exclusive elements (needed because of limitations of
     // IPPL reductions ops):
     NDIndex<D> bev;
-    for (d=0; d<D; d++) bev[d] = Index(1,nverts[d]-2,1);
+    for (d = 0; d < D; d++) bev[d] = Index(1,nverts[d]-2,1);
     FieldLayout<D> templayout(bev);
     BareField<Vektor<double,D>,D> temp(templayout);
     temp[bev] = vectorVert[bev];
     sumVectorVert = sum(temp);
-    unsigned totred=1; for (d=0; d<D; d++) totred *= nverts[d] - 2;
+    unsigned totred=1;
+    for (d = 0; d < D; d++) totred *= nverts[d] - 2;
     sumVectorVert /= totred;
     Vektor<double,D> diffVectorVert;
     diffVectorVert = sumVectorVert - unit;
     double magDiffVectorVert = 0.0;
-    for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
+    for (d = 0; d < D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
     magDiffVectorVert = sqrt(magDiffVectorVert);
     EXPECT_NEAR(abs(magDiffVectorVert), 0, roundOffError);
     //---------------------------------------------------------------------------
@@ -171,30 +172,31 @@ TEST(Meshes, Cartesian)
     // Assign positive-sloping linear ramp values into the cell-centered
     // Field<scalar>:
     scalarCell = 0.0;
-    for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d);
+    for (d = 0; d < D; d++) scalarCell[cells] += vectorCell[cells](d);
     // Now take the gradient:
     vectorCell = Grad(scalarCell, vectorCell);
     // The value should be (1.0,1.0,1.0) for all elements one at least one
     // removed from the last-physical-layer elements. Last-physical-layer
     // elements will be different because the BC available in IPPL don't really
     // do the kind of linear extrapolation appropriate for the needs here:
-    for (d=0; d<D; d++) unit[d] = 1.0;
+    for (d = 0; d < D; d++) unit[d] = 1.0;
     Vektor<double,D> sumVectorCell;
     // Use temporary, smaller BareField as a reduced-by-two vector Field to hold
     // only the boundary-exclusive elements (needed because of limitations of
     // IPPL reductions ops):
     NDIndex<D> bec;
-    for (d=0; d<D; d++) bec[d] = Index(1,ncells[d]-2,1);
+    for (d = 0; d < D; d++) bec[d] = Index(1,ncells[d]-2,1);
     FieldLayout<D> templayout2(bec);
     BareField<Vektor<double,D>,D> temp2(templayout);
     temp2[bec] = vectorCell[bec];
     sumVectorCell = sum(temp2);
-    unsigned totredc=1; for (d=0; d<D; d++) totredc *= ncells[d] - 2;
+    unsigned totredc=1;
+    for (d = 0; d < D; d++) totredc *= ncells[d] - 2;
     sumVectorCell /= totredc;
     Vektor<double,D> diffVectorCell;
     diffVectorCell = sumVectorCell - unit;
     double magDiffVectorCell = 0.0;
-    for (d=0; d<D; d++) magDiffVectorCell += diffVectorCell(d)*diffVectorCell(d);
+    for (d = 0; d < D; d++) magDiffVectorCell += diffVectorCell(d)*diffVectorCell(d);
     magDiffVectorCell = sqrt(magDiffVectorCell);
     EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError);
     //---------------------------------------------------------------------------
@@ -216,10 +218,11 @@ TEST(Meshes, Cartesian)
     temp[bev] = vectorVert[bev];
     sumVectorVert = sum(temp);
     sumVectorVert /= totred;
-    Vektor<double,D> deesVector; for (d=0; d<D; d++) deesVector(d) = 1.0*D;
+    Vektor<double,D> deesVector;
+    for (d = 0; d < D; d++) deesVector(d) = 1.0*D;
     diffVectorVert = sumVectorVert - deesVector;
     magDiffVectorVert = 0.0;
-    for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
+    for (d = 0; d < D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
     magDiffVectorVert = sqrt(magDiffVectorVert);
     EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError);
     //---------------------------------------------------------------------------
@@ -235,14 +238,14 @@ TEST(Meshes, Cartesian)
     // z*z_hat), the result should be the identity tensor (NRL Plasma Formulary
     // Vector Identities section):
     Tenzor<double,D> identityTensor = 0.0;
-    for (d=0; d<D; d++) identityTensor(d,d) = 1.0;
+    for (d = 0; d < D; d++) identityTensor(d,d) = 1.0;
     Tenzor<double,D> sumTensorCell = sum(tensorCell);
     sumTensorCell /= totcells;
     Tenzor<double,D> diffTensorCell;
     diffTensorCell = sumTensorCell - identityTensor;
     double magDiffTensorCell = 0.0;
-    for (d=0; d<D; d++) {
-        for (unsigned int d2=0; d2<D; d2++) {
+    for (d = 0; d < D; d++) {
+        for (unsigned int d2 = 0; d2 < D; d2++) {
             magDiffTensorCell += diffTensorCell(d,d2)*diffTensorCell(d,d2);
         }
     }
@@ -325,7 +328,7 @@ TEST(Meshes, Cartesian)
     v(0) = 1.5; v(1) = 4.5; v(2) = 9.5;
     ndi = mesh.getNearestVertex(v);
     // nearest vertex should be (1,1,1)
-    for (unsigned int i=0; i<D; i++) {
+    for (unsigned int i = 0; i < D; i++) {
         EXPECT_EQ((int)ndi[0].first(),  1);
         EXPECT_EQ((int)ndi[0].length(), 1);
     }
@@ -333,7 +336,7 @@ TEST(Meshes, Cartesian)
     Vektor<double,D> v1;
     v1 = mesh.getVertexPosition(ndi);
     v(0) = 2.0; v(1) = 4.0; v(2) = 12.0; // Correct value
-    for (unsigned int i=0; i<D; i++) {
+    for (unsigned int i = 0; i < D; i++) {
         EXPECT_NEAR(v1(i), v(i), roundOffError);
     }
     //---------------------------------------------------------------------------
@@ -346,7 +349,7 @@ TEST(Meshes, Cartesian)
     v = mesh.getDeltaVertex(ndi);
     Vektor<double,D> vcorrect;
     vcorrect(0) = 2.0; vcorrect(1) = 4.0; vcorrect(2) = 9.0;
-    for (unsigned int i=0; i<D; i++) {
+    for (unsigned int i = 0; i < D; i++) {
         EXPECT_NEAR(vcorrect(i), v(i), roundOffError);
     }
 }
\ No newline at end of file
diff --git a/tests/ippl_src/Meshes/CartesianCentering.cpp b/tests/ippl_src/Meshes/CartesianCentering.cpp
index 33cedbe5f..6fe18d7e4 100644
--- a/tests/ippl_src/Meshes/CartesianCentering.cpp
+++ b/tests/ippl_src/Meshes/CartesianCentering.cpp
@@ -15,7 +15,7 @@ namespace {
     void hardCodedOutput(std::string filename); // Prototype of function defined below.
     bool thediff(std::string filename1, std::string filename2);
 
-    extern const CenteringEnum zz[2] = {CELL, VERTEX};
+    CenteringEnum zz[2] = {CELL, VERTEX};
 }
 
 // template definitions
diff --git a/tests/opal_test_utilities/Maxwell.cpp b/tests/opal_test_utilities/Maxwell.cpp
index f9579b76d..6ac095149 100644
--- a/tests/opal_test_utilities/Maxwell.cpp
+++ b/tests/opal_test_utilities/Maxwell.cpp
@@ -12,9 +12,9 @@
 #include "AbsBeamline/Component.h"
 #include "opal_test_utilities/Maxwell.h"
 
-MaxwellTest::MaxwellTest(Vector_t dR, double dt, Component* field) :
+MaxwellTest::MaxwellTest(Vector_t dR, double /*dt*/, Component* field) :
     field_m(field),
-    dR_m(dR), dt_m(dt) {
+    dR_m(dR) /*, dt_m(dt)*/ {
 }
 
 
@@ -41,7 +41,7 @@ std::vector< std::vector<double> > MaxwellTest::partialsDerivB(const Vector_t &R
         field_m->apply(R_pprev, P, t, E, B_pprev);
         field_m->apply(R_nnext, P, t, E, B_nnext);
         for(int j = 0; j < 3; j++) {
-              allPartials[i][j] = 
+              allPartials[i][j] =
                    (B_pprev[j]-8*B_prev[j]+8*B_next[j]-B_nnext[j])/(12*dR_m(i));
         }
     }
diff --git a/tests/opal_test_utilities/Maxwell.h b/tests/opal_test_utilities/Maxwell.h
index 342519eac..89162df10 100644
--- a/tests/opal_test_utilities/Maxwell.h
+++ b/tests/opal_test_utilities/Maxwell.h
@@ -5,7 +5,7 @@
 class Component;
 
 /** MaxwellTest is a small utility for testing field objects
- * 
+ *
  *  Calculated numerical derivatives for calculating maxwell's equations and
  *  checking that field maps are physical.
  */
@@ -19,7 +19,7 @@ class MaxwellTest {
 
     Vector_t getDR() const {return dR_m;}
     void setDR(Vector_t dR) {dR_m = dR;}
-    
+
     std::vector< std::vector<double> > partialsDerivB(const Vector_t &R, double t) const;
     std::vector< std::vector<double> > partialsDerivA(const Vector_t &R, double t) const;
     double divB(const Vector_t &R, double t) const;
@@ -32,5 +32,5 @@ class MaxwellTest {
   private:
     std::unique_ptr<Component> field_m;
     Vector_t dR_m;
-    double dt_m;
+    //double dt_m;
 };
-- 
GitLab