Index: src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp
===================================================================
--- src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp	(revision 748fc7c0d1024191307cd0382559ca5a2f64eacb)
+++ src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp	(revision 5b1e5e3171f6df6d1ae7f2ebc67e13bbf15c764b)
@@ -62,6 +62,6 @@
 const double grid_value=1.;
 
-#define NUMBEROFSAMPLES(n) (size_t)(pow(pow(2,n),3))
-#define DOMAINVOLUME(l) (size_t)pow(l,3)
+#define NUMBEROFSAMPLES(n) (size_t)(pow(pow(2,n),(int)NDIM))
+#define DOMAINVOLUME(l) (size_t)pow(l,(int)NDIM)
 
 // Registers the fixture into the 'registry'
@@ -75,6 +75,6 @@
 
   // create the grid
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 1., 1., 1. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 1., 1., 1. };
   for (size_t i=0; i< DOMAINVOLUME(1)*NUMBEROFSAMPLES(2); ++i)
     values += grid_value;
@@ -94,6 +94,6 @@
 {
   // check illegal grid
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 2., 2., 2. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 2., 2., 2. };
   SamplingGridProperties illegal_props(begin, end, 5);
   SamplingGridProperties legal_props(begin, end, 2);
@@ -125,8 +125,8 @@
 void SamplingGridTest::isCongruent_Test()
 {
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 2., 2., 2. };
-  const double otherbegin[3] = { 0.1, 0.1, 0.1 };
-  const double otherend[3] = { 1., 1., 1. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 2., 2., 2. };
+  const double otherbegin[NDIM] = { 0.1, 0.1, 0.1 };
+  const double otherend[NDIM] = { 1., 1., 1. };
   SamplingGridProperties illegal_begin_props(otherbegin, end, 5);
   SamplingGridProperties illegal_end_props(begin, otherend, 5);
@@ -135,8 +135,8 @@
 
   // differing windows
-//  const double begin_window[3] = { 0.5, 0.5, 0.5 };
-//  const double end_window[3] = { 1., 1., 1. };
-  const double otherbegin_window[3] = { 0.45, 0.45, 0.45 };
-  const double otherend_window[3] = { 1.05, 1.05, 1.05 };
+//  const double begin_window[NDIM] = { 0.5, 0.5, 0.5 };
+//  const double end_window[NDIM] = { 1., 1., 1. };
+  const double otherbegin_window[NDIM] = { 0.45, 0.45, 0.45 };
+  const double otherend_window[NDIM] = { 1.05, 1.05, 1.05 };
 
   // check that incompatible grid are also incongruent
@@ -238,6 +238,6 @@
 
   // create another one and check its size, too
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 1., 1., 1. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 1., 1., 1. };
   for (size_t level = 3; level<=6; ++level) {
     values.clear();
@@ -257,13 +257,13 @@
 {
   // we have a grid with size of one, extend to twice the size and check
-  const double begin[3] = { 0., 0., 0. };
+  const double begin[NDIM] = { 0., 0., 0. };
   const double size = 2.;
-  const double end[3] = { size, size, size };
-  double offset[3];
+  const double end[NDIM] = { size, size, size };
+  double offset[NDIM];
   for (offset[0] = 0.; offset[0] <= 1.; offset[0] += .5)
     for (offset[1] = 0.; offset[1] <= 1.; offset[1] += .5)
       for (offset[2] = 0.; offset[2] <= 1.; offset[2] += .5) {
-        const double window_begin[3] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
-        const double window_end[3] = { 1.+offset[0], 1.+offset[1], 1.+offset[2]};
+        const double window_begin[NDIM] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
+        const double window_end[NDIM] = { 1.+offset[0], 1.+offset[1], 1.+offset[2]};
         SamplingGrid newgrid(begin, end, 2);
         newgrid.setWindowSize(window_begin, window_end);
@@ -292,17 +292,17 @@
 {
   std::cout << "SamplingGridTest::extendWindow_asymmetric_Test()" << std::endl;
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 2., 2., 2. };
-  double offset[3];
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 2., 2., 2. };
+  double offset[NDIM];
   for (offset[0] = 0.; offset[0] <= 1.; offset[0] += .5)
     for (offset[1] = 0.; offset[1] <= 1.; offset[1] += .5)
       for (offset[2] = 0.; offset[2] <= 1.; offset[2] += .5) {
-        const double window_begin[3] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
-        const double window_end[3] = { 1.+offset[0], 1.+offset[1], 1.+offset[2]};
+        const double window_begin[NDIM] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
+        const double window_end[NDIM] = { 1.+offset[0], 1.+offset[1], 1.+offset[2]};
         SamplingGrid newgrid(begin, end, 2);
         CPPUNIT_ASSERT_EQUAL( (size_t)0, newgrid.getWindowGridPoints() );
         newgrid.setWindowSize(window_begin, window_end);
         // window size is only half of domain size
-        const size_t max_samples = NUMBEROFSAMPLES(newgrid.level)*pow(0.5,3);
+        const size_t max_samples = NUMBEROFSAMPLES(newgrid.level)*pow(0.5,(int)NDIM);
         for (size_t i=0; i< max_samples; ++i)
           newgrid.sampled_grid += grid_value*i;
@@ -326,11 +326,11 @@
   // create values for half-sized window
   values.clear();
-  for (size_t i=0; i< (size_t)pow(.5*pow(2,2),3); ++i)
+  for (size_t i=0; i< (size_t)pow(.5*pow(2,2),(int)NDIM); ++i)
     values += grid_value;
 
   // check that too large a window throws
 #ifndef NDEBUG
-  const double begin[3] = { .5, .5, .5 };
-  const double wrongend[3] = { 1.5, 1.5, 1.5 };
+  const double begin[NDIM] = { .5, .5, .5 };
+  const double wrongend[NDIM] = { 1.5, 1.5, 1.5 };
   std::cout << "The following assertion is intended and does not indicate a failure of the test." << std::endl;
   CPPUNIT_ASSERT_THROW( grid->addOntoWindow(begin, wrongend, values, +1.), Assert::AssertionFailure );
@@ -338,10 +338,10 @@
 
   // create another window from (.5,.5,.5) to (1., 1., 1.)
-  double offset[3];
+  double offset[NDIM];
   for (offset[0] = 0.; offset[0] <= .5; offset[0] += .5)
     for (offset[1] = 0.; offset[1] <= .5; offset[1] += .5)
       for (offset[2] = 0.; offset[2] <= .5; offset[2] += .5) {
-        const double window_begin[3] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
-        const double window_end[3] = { .5+offset[0], .5+offset[1], .5+offset[2]};
+        const double window_begin[NDIM] = { 0.+offset[0], 0.+offset[1], 0.+offset[2]};
+        const double window_end[NDIM] = { .5+offset[0], .5+offset[1], .5+offset[2]};
 
         SamplingGrid newgrid(*grid);
@@ -350,5 +350,5 @@
 
         // check integral to be one and one eighth times the old value
-        CPPUNIT_ASSERT_EQUAL( (1.+pow(.5,3))*grid_value, newgrid.integral() );
+        CPPUNIT_ASSERT_EQUAL( (1.+pow(.5,(int)NDIM))*grid_value, newgrid.integral() );
       }
 }
@@ -383,6 +383,6 @@
 {
   // create other grid
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 1., 1., 1. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 1., 1., 1. };
   SamplingGrid::sampledvalues_t othervalues;
   const double othergrid_value = 1.5;
@@ -407,6 +407,6 @@
 {
   // create other grid
-  const double begin[3] = { 0., 0., 0. };
-  const double end[3] = { 1., 1., 1. };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 1., 1., 1. };
   SamplingGrid::sampledvalues_t othervalues;
   const double othergrid_value = 1.5;
@@ -431,12 +431,12 @@
 void SamplingGridTest::equality_Test()
 {
-  const double begin[3] = { 0., 0., 0. };
-  const double otherbegin[3] = { .5, 0.1, -0.5 };
-  const double end[3] = { 1., 1., 1. };
-  const double otherend[3] = { 2., 2., 2. };
-  const double begin_window[3] = { 0., 0., 0. };
-  const double otherbegin_window[3] = { .75, 0.1, 0. };
-  const double end_window[3] = { 1., 1., 1. };
-  const double otherend_window[3] = { .9, .9, .9 };
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double otherbegin[NDIM] = { .5, 0.1, -0.5 };
+  const double end[NDIM] = { 1., 1., 1. };
+  const double otherend[NDIM] = { 2., 2., 2. };
+  const double begin_window[NDIM] = { 0., 0., 0. };
+  const double otherbegin_window[NDIM] = { .75, 0.1, 0. };
+  const double end_window[NDIM] = { 1., 1., 1. };
+  const double otherend_window[NDIM] = { .9, .9, .9 };
 
   // create other grid
@@ -515,2 +515,3 @@
   delete samegrid;
 }
+
