Add unit tests for selection position calculation.
commitb6a7c3272a243b0b00f050612bb940f78e973729
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 29 Apr 2013 03:35:41 +0000 (29 06:35 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 25 Jul 2013 06:26:13 +0000 (25 08:26 +0200)
treea361a25e2f36cf5a3259c4968c439fac7adcd565
parente03f582b723f97fee18c975cb92de0060c1c30fb
Add unit tests for selection position calculation.

Add unit tests for most functionality of poscalc.*.  These tests also
cover centerofmass.*.

Fixed two issues:
- POS_MASKONLY calculations had an inconsistent group set in the output
  positions (which was visible in the selection interface, returning
  incorrect set of atoms for the selection).
- Force calculation was incorrect.
These do not affect g_select, so only fixed for 5.0.

Part of #651, related to #1221.

Change-Id: I4dc6475f53fb3b1559bae9296f8c9f3e6dd14bf7
18 files changed:
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/centerofmass.h
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/tests/CMakeLists.txt
src/gromacs/selection/tests/poscalc.cpp [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesAtomPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesGroupCOGPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesGroupCOMPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesPositionMask.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesPositionsWithCompleteMax.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesPositionsWithCompleteWhole.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesResidueCOGPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_ComputesResidueCOMPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_HandlesIdenticalStaticCalculations.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/PositionCalculationTest_HandlesOverlappingStaticCalculations.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/referencedata.xsl
src/gromacs/selection/tests/toputils.cpp
src/gromacs/selection/tests/toputils.h