Merge branch release-5-1
[alexxy/gromacs.git] / src / gromacs / correlationfunctions / tests / autocorr.cpp
index 5631d3f43550dd7e4b608eb02909bb4e977991dd..561ecb99e68ddaf86cf5aca407ba176884bbb05a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -104,16 +104,14 @@ class AutocorrTest : public ::testing::Test
 
         static void TearDownTestCase()
         {
-
             sfree(tempArgs_);
             tempArgs_ = NULL;
             gmx_fft_cleanup();
         }
 
-        void test(unsigned long mode)
+        void test(unsigned long mode, bool bNormalize)
         {
-            bool              bAverage      = false;
-            bool              bNormalize    = true;
+            bool              bAverage      = true;
             bool              bVerbose      = false;
             int               nrRestart     = 1;
             int               dim           = getDim(mode);
@@ -134,11 +132,11 @@ class AutocorrTest : public ::testing::Test
                             effnNONE);
 
             double testResult = 0;
-            for (int i = 0; i < nrFrames_; i++)
+            for (int i = 0; i < get_acfnout(); i++)
             {
                 testResult += result[i];
             }
-            checker_.checkSequenceArray(nrFrames_, ptr,
+            checker_.checkSequenceArray(get_acfnout(), ptr,
                                         "AutocorrelationFunction");
             checker_.checkReal(testResult, "Integral");
         }
@@ -182,47 +180,52 @@ t_pargs                   * AutocorrTest::tempArgs_;
 
 TEST_F (AutocorrTest, EacNormal)
 {
-    test(eacNormal);
+    test(eacNormal, true);
+}
+
+TEST_F (AutocorrTest, EacNoNormalize)
+{
+    test(eacNormal, false);
 }
 
 TEST_F (AutocorrTest, EacCos)
 {
-    test(eacCos);
+    test(eacCos, true);
 }
 
 TEST_F (AutocorrTest, EacVector)
 {
-    test(eacVector);
+    test(eacVector, true);
 }
 
 TEST_F (AutocorrTest, EacRcross)
 {
-    test(eacRcross);
+    test(eacRcross, true);
 }
 
 TEST_F (AutocorrTest, EacP0)
 {
-    test(eacP0);
+    test(eacP0, true);
 }
 
 TEST_F (AutocorrTest, EacP1)
 {
-    test(eacP1);
+    test(eacP1, true);
 }
 
 TEST_F (AutocorrTest, EacP2)
 {
-    test(eacP2);
+    test(eacP2, true);
 }
 
 TEST_F (AutocorrTest, EacP3)
 {
-    test(eacP3);
+    test(eacP3, true);
 }
 
 TEST_F (AutocorrTest, EacP4)
 {
-    test(eacP4);
+    test(eacP4, true);
 }