Avoid rounding errors affecting results in one test
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 30 Apr 2015 09:53:15 +0000 (12:53 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 5 May 2015 15:44:10 +0000 (17:44 +0200)
Change the input for one of 'gmx gangle' tests such that it does not
produce angles that are exactly at an edge of the three-bin histogram
used in the test.  Rounding could affect the bin into which the angle
was assigned to, causing the test to fail erroneously.

Fixes #1716

Change-Id: I9979a8dfee0b870b3904fa28e274540f892f542d

src/gromacs/trajectoryanalysis/tests/angle.cpp
src/gromacs/trajectoryanalysis/tests/refdata/AngleModuleTest_HandlesOneVsMultipleVectorGroupsAngles.xml

index 11c51d1f676f08a4aaacf742c2478c27ef8b99c3..06f9af93ee3036914e9698ef207fafaff11bff29 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, 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.
@@ -190,7 +190,7 @@ TEST_F(AngleModuleTest, HandlesOneVsMultipleVectorGroupsAngles)
         "angle",
         "-g1", "vector",
         "-group1",
-        "resname RV1 and name A1 A2",
+        "resname RV2 and name A1 A2",
         "resname RV3 RV4 and name A1 A2",
         "-g2", "plane",
         "-group2",
index 954ac5fb4e7059b9e903e335ce4e65be3c3aa869..26f0b5f1da0eb95d679b4399f2af205df334d908 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
 <ReferenceData>
-  <String Name="CommandLine">angle -g1 vector -group1 'resname RV1 and name A1 A2' 'resname RV3 RV4 and name A1 A2' -g2 plane -group2 'resname RP1 RP2 and name A1 A2 A3' -binw 60</String>
+  <String Name="CommandLine">angle -g1 vector -group1 'resname RV2 and name A1 A2' 'resname RV3 RV4 and name A1 A2' -g2 plane -group2 'resname RP1 RP2 and name A1 A2 A3' -binw 60</String>
   <OutputData Name="Data">
     <AnalysisData Name="angle">
       <DataFrame Name="Frame0">
           <Int Name="Count">2</Int>
           <Int Name="DataSet">0</Int>
           <DataValue>
-            <Real Name="Value">90</Real>
+            <Real Name="Value">180</Real>
           </DataValue>
           <DataValue>
-            <Real Name="Value">120.00000000000001</Real>
+            <Real Name="Value">45</Real>
           </DataValue>
         </DataValues>
         <DataValues>
@@ -34,7 +34,7 @@
         <DataValues>
           <Int Name="Count">2</Int>
           <DataValue>
-            <Real Name="Value">105</Real>
+            <Real Name="Value">112.5</Real>
           </DataValue>
           <DataValue>
             <Real Name="Value">112.5</Real>
@@ -48,7 +48,7 @@
         <DataValues>
           <Int Name="Count">2</Int>
           <DataValue>
-            <Real Name="Value">0</Real>
+            <Real Name="Value">0.0083333333333333332</Real>
             <Real Name="Error">0</Real>
           </DataValue>
           <DataValue>
@@ -62,7 +62,7 @@
         <DataValues>
           <Int Name="Count">2</Int>
           <DataValue>
-            <Real Name="Value">0.0083333333333333332</Real>
+            <Real Name="Value">0</Real>
             <Real Name="Error">0</Real>
           </DataValue>
           <DataValue>