Reform energy output tests
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 7 Feb 2019 09:51:41 +0000 (10:51 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 8 Feb 2019 09:04:53 +0000 (10:04 +0100)
commit404a9bff8bbfb1a8e8d724fd125822a6e81e518f
treef05056c06b7e430153bd5a2db52175f4cc33f371
parentd8a1069afeff93315210b68a32c960abda6b1311
Reform energy output tests

Separated tests of t_mdebin from tests of t_ebin to prepare for making
t_mdebin a proper class. Improved coverage of t_mdebin (and indirectly
t_ebin). Made done_ebin deallocate ebin, which means scoped_cptr is
now more usable.

Made some operations on t_mdebin more safe, by checking for nullptr or
reordering logic. Technically there are now two more branches when
writing energy output.

Change-Id: I4b056f660d16ce7af225e229030d6729a34acefe
src/gromacs/mdlib/ebin.cpp
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/tests/CMakeLists.txt
src/gromacs/mdlib/tests/ebin.cpp [new file with mode: 0644]
src/gromacs/mdlib/tests/mdebin.cpp
src/gromacs/mdlib/tests/refdata/MdebinTest_HandlesEmptyAverages.xml [new file with mode: 0644]
src/gromacs/mdlib/tests/refdata/MdebinTest_HandlesSingleStep.xml [new file with mode: 0644]
src/gromacs/mdlib/tests/refdata/MdebinTest_HandlesTwoSteps.xml [new file with mode: 0644]
src/gromacs/mdlib/tests/refdata/PrEbinTest_HandlesAverages.xml [moved from src/gromacs/mdlib/tests/refdata/PrintEbin_pr_ebin_HandlesAverages.xml with 69% similarity]
src/gromacs/mdlib/tests/refdata/PrEbinTest_HandlesEmptyAverages.xml [moved from src/gromacs/mdlib/tests/refdata/PrintEbin_pr_ebin_HandlesEmptyAverages.xml with 82% similarity]
src/gromacs/mdlib/tests/refdata/PrintEbin_print_ebin_HandlesEmptyAverages.xml [deleted file]