Fix input MDP contents for swap and IMD tests
authorAleksei Iupinov <a.yupinov@gmail.com>
Thu, 1 Feb 2018 16:39:10 +0000 (17:39 +0100)
committerAleksei Iupinov <a.yupinov@gmail.com>
Fri, 2 Feb 2018 15:27:10 +0000 (16:27 +0100)
Change I7a9a7c60591 moved the input MDP contents from files
to std::string's, and in doing so butchered the line breaks
for no good reason, silently breaking the tests.
This is now fixed, using C++11 raw string literals.

Change-Id: Ia4abc26ce67fdebba5f830c2461743b38d944956

src/programs/mdrun/tests/interactiveMD.cpp
src/programs/mdrun/tests/swapcoords.cpp

index 4cc5ebcea29a73151d14918ff6d68efde06cf488..30a0ac9dc6a5419dd788bf313d98c67dcc8f3f85 100644 (file)
@@ -76,19 +76,18 @@ typedef gmx::test::ImdTestFixture ImdTest;
  */
 TEST_F(ImdTest, ImdCanRun)
 {
-    std::string name = "spc2";
-    runner_.useTopGroAndNdxFromDatabase(name.c_str());
-    std::string mdpContents = "\
-            -dt                       = 0.004\
-            -nsteps                   = 2\
-            -tcoupl                   = Berendsen\
-            -tc-grps                  = System\
-            -tau-t                    = 0.5\
-            -ref-t                    = 300\
-            -constraints              = all-bonds\
-            -cutoff-scheme            = Verlet\
-            -IMD-group                = SecondWaterMolecule\
-    ";
+    runner_.useTopGroAndNdxFromDatabase("spc2");
+    const std::string mdpContents = R"(
+        dt            = 0.004
+        nsteps        = 2
+        tcoupl        = Berendsen
+        tc-grps       = System
+        tau-t         = 0.5
+        ref-t         = 300
+        constraints   = all-bonds
+        cutoff-scheme = Verlet
+        IMD-group     = SecondWaterMolecule
+    )";
     runner_.useStringAsMdpFile(mdpContents);
 
     EXPECT_EQ(0, runner_.callGrompp());
index 26ba962cac5c80a4292cd3d9c6ec9655df36b265..3a207c3129921a4815bd717827b53b84ce19e145 100644 (file)
@@ -76,41 +76,41 @@ typedef gmx::test::SwapTestFixture CompelTest;
  * the swap state variables can be written to and read from checkpoint. */
 TEST_F(CompelTest, SwapCanRun)
 {
-    std::string name = "OctaneSandwich";
-    runner_.useTopGroAndNdxFromDatabase(name.c_str());
-    std::string mdpContents = "\
-    dt                       = 0.005\
-    nsteps                   = 2\
-    define                   = -DPOSRES\
-    tcoupl                   = Berendsen\
-    tc-grps                  = System\
-    tau-t                    = 0.5\
-    ref-t                    = 300\
-    constraints              = all-bonds\
-    cutoff-scheme            = Verlet\
-    swapcoords               = Z\
-    swap_frequency           = 1\
-    split_group0             = Ch0\
-    split_group1             = Ch1\
-    massw_split0             = yes\
-    massw_split1             = no\
-    solvent_group            = SOL\
-    cyl0_r                   = 1\
-    cyl0_up                  = 0.5\
-    cyl0_down                = 0.5\
-    cyl1_r                   = 1\
-    cyl1_up                  = 0.5\
-    cyl1_down                = 0.5\
-    coupl_steps              = 5\
-    iontypes                 = 2\
-    iontype0-name            = NA+\
-    iontype0-in-A            = 8\
-    iontype0-in-B            = 11\
-    iontype1-name            = CL-\
-    iontype1-in-A            = -1\
-    iontype1-in-B            = -1\
-    threshold                = 1\
-    ";
+    runner_.useTopGroAndNdxFromDatabase("OctaneSandwich");
+    const std::string mdpContents = R"(
+        dt                       = 0.005
+        nsteps                   = 2
+        define                   = -DPOSRES
+        tcoupl                   = Berendsen
+        tc-grps                  = System
+        tau-t                    = 0.5
+        ref-t                    = 300
+        constraints              = all-bonds
+        cutoff-scheme            = Verlet
+        swapcoords               = Z
+        swap_frequency           = 1
+        split_group0             = Ch0
+        split_group1             = Ch1
+        massw_split0             = yes
+        massw_split1             = no
+        solvent_group            = SOL
+        cyl0_r                   = 1
+        cyl0_up                  = 0.5
+        cyl0_down                = 0.5
+        cyl1_r                   = 1
+        cyl1_up                  = 0.5
+        cyl1_down                = 0.5
+        coupl_steps              = 5
+        iontypes                 = 2
+        iontype0-name            = NA+
+        iontype0-in-A            = 8
+        iontype0-in-B            = 11
+        iontype1-name            = CL-
+        iontype1-in-A            = -1
+        iontype1-in-B            = -1
+        threshold                = 1
+     )";
+
     runner_.useStringAsMdpFile(mdpContents);
 
     EXPECT_EQ(0, runner_.callGrompp());