Enable clang tidy/warnings for tests
[alexxy/gromacs.git] / src / gromacs / awh / tests / bias.cpp
index 51fb32b0b84532120116f61f152ebb9a92deb232..86e28c0cf0974978d208314f75d42e6d9c08eb61 100644 (file)
@@ -47,6 +47,7 @@
 
 #include "gromacs/awh/correlationgrid.h"
 #include "gromacs/awh/pointstate.h"
+#include "gromacs/compat/make_unique.h"
 #include "gromacs/mdtypes/awh-params.h"
 #include "gromacs/utility/stringutil.h"
 
@@ -107,7 +108,7 @@ static AwhTestParameters getAwhTestParameters(int eawhgrowth,
     double                 k           = 1000;
     int64_t                seed        = 93471803;
 
-    params.dimParams.push_back(DimParams(convFactor, k, params.beta));
+    params.dimParams.emplace_back(convFactor, k, params.beta);
 
     AwhParams             &awhParams = params.awhParams;
 
@@ -202,7 +203,7 @@ class BiasTest : public ::testing::TestWithParam<BiasTestParameters>
             int    numSamples = coordinates_.size() - 1; // No sample taken at step 0
             GMX_RELEASE_ASSERT(numSamples % params.awhParams.numSamplesUpdateFreeEnergy == 0, "This test is intended to reproduce the situation when the might need to write output during a normal AWH run, therefore the number of samples should be a multiple of the free-energy update interval (but the test should also runs fine without this condition).");
 
-            bias_ = std::unique_ptr<Bias>(new Bias(-1, params.awhParams, params.awhBiasParams, params.dimParams, params.beta, mdTimeStep, 1, "", Bias::ThisRankWillDoIO::No, disableUpdateSkips));
+            bias_ = gmx::compat::make_unique<Bias>(-1, params.awhParams, params.awhBiasParams, params.dimParams, params.beta, mdTimeStep, 1, "", Bias::ThisRankWillDoIO::No, disableUpdateSkips);
         }
 };
 
@@ -211,7 +212,7 @@ TEST_P(BiasTest, ForcesBiasPmf)
     gmx::test::TestReferenceData     data;
     gmx::test::TestReferenceChecker  checker(data.rootChecker());
 
-    Bias                            &bias = *bias_.get();
+    Bias                            &bias = *bias_;
 
     /* Make strings with the properties we expect to be different in the tests.
      * These also helps to interpret the reference data.