Use GROMACS wrappers for EXPECT_THROW/NO_THROW in PME tests
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 20 Feb 2020 13:29:34 +0000 (14:29 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Thu, 20 Feb 2020 20:28:31 +0000 (21:28 +0100)
The EXPECT_THROW_GMX and EXPECT_NO_THROW_GMX wrappers provide more
information in case of test failure.

Change-Id: Ib935425ff3c0436fcefb88ea54c9e5c0501c0084

src/gromacs/ewald/tests/pmebsplinetest.cpp
src/gromacs/ewald/tests/pmegathertest.cpp
src/gromacs/ewald/tests/pmesolvetest.cpp
src/gromacs/ewald/tests/pmesplinespreadtest.cpp

index 19157f758ebffb956034b74359a464a55e6c6933..b6a4e9e35f81b69e24f16180b26b36bfcabcd898 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020, 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.
@@ -124,13 +124,13 @@ public:
 using PmeBSplineModuliFailureTest = PmeBSplineModuliTest;
 TEST_P(PmeBSplineModuliFailureTest, Throws)
 {
-    EXPECT_THROW(runTest(), InconsistentInputError);
+    EXPECT_THROW_GMX(runTest(), InconsistentInputError);
 }
 //! Correctness test alias
 using PmeBSplineModuliCorrectnessTest = PmeBSplineModuliTest;
 TEST_P(PmeBSplineModuliCorrectnessTest, ReproducesValues)
 {
-    EXPECT_NO_THROW(runTest());
+    EXPECT_NO_THROW_GMX(runTest());
 }
 
 /* Invalid input instances */
index 325a0cdc69ef155da3fc55f2f6a10b0b5a36cebc..82003b203abf1319fa9872e43756879d05c26719 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020, 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.
@@ -286,7 +286,8 @@ public:
             if (!supportedInput)
             {
                 /* Testing the failure for the unsupported input */
-                EXPECT_THROW(pmeInitWrapper(&inputRec, codePath, nullptr, nullptr, box), NotImplementedError);
+                EXPECT_THROW_GMX(pmeInitWrapper(&inputRec, codePath, nullptr, nullptr, box),
+                                 NotImplementedError);
                 continue;
             }
 
@@ -343,7 +344,7 @@ InputDataByAtomCount PmeGatherTest::s_inputAtomDataSets_;
 //! Test for PME force gathering
 TEST_P(PmeGatherTest, ReproducesOutputs)
 {
-    EXPECT_NO_THROW(runTest());
+    EXPECT_NO_THROW_GMX(runTest());
 }
 
 //! Instantiation of the PME gathering test
index 99af453394a7d1c95c2786d2e2e38ce1f85ffac6..0cc1eec9a8e8df2ea12ee1ef391d0f31ecdd895f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020, 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.
@@ -114,9 +114,9 @@ public:
             if (!supportedInput)
             {
                 /* Testing the failure for the unsupported input */
-                EXPECT_THROW(pmeInitEmpty(&inputRec, codePath, nullptr, nullptr, box, ewaldCoeff_q,
-                                          ewaldCoeff_lj),
-                             NotImplementedError);
+                EXPECT_THROW_GMX(pmeInitEmpty(&inputRec, codePath, nullptr, nullptr, box,
+                                              ewaldCoeff_q, ewaldCoeff_lj),
+                                 NotImplementedError);
                 continue;
             }
 
@@ -248,7 +248,7 @@ public:
 /*! \brief Test for PME solving */
 TEST_P(PmeSolveTest, ReproducesOutputs)
 {
-    EXPECT_NO_THROW(runTest());
+    EXPECT_NO_THROW_GMX(runTest());
 }
 
 /* Valid input instances */
index 43a459420e10a9666323e5a7e4e26b5d8ff30cb5..fba028fa8c1fcf377eedaa0dc5b4ce44fdd06172 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020, 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.
@@ -131,7 +131,8 @@ public:
             if (!supportedInput)
             {
                 /* Testing the failure for the unsupported input */
-                EXPECT_THROW(pmeInitWrapper(&inputRec, codePath, nullptr, nullptr, box), NotImplementedError);
+                EXPECT_THROW_GMX(pmeInitWrapper(&inputRec, codePath, nullptr, nullptr, box),
+                                 NotImplementedError);
                 continue;
             }
 
@@ -263,7 +264,7 @@ public:
 /*! \brief Test for spline parameter computation and charge spreading. */
 TEST_P(PmeSplineAndSpreadTest, ReproducesOutputs)
 {
-    EXPECT_NO_THROW(runTest());
+    EXPECT_NO_THROW_GMX(runTest());
 }
 
 /* Valid input instances */