Add appendIf(..) method and tests for MessageStringCollector
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 13 May 2021 08:06:19 +0000 (11:06 +0300)
committerArtem Zhmurov <zhmurov@gmail.com>
Thu, 13 May 2021 08:34:36 +0000 (11:34 +0300)
commitaa04952d9466cb493573af9312dfbfc02cb66e14
treed16fbebc8d1ae945c000923cf09ff351d5bca946
parent86b442ebef2ca6bd30d16254aca7aae86ea522ad
Add appendIf(..) method and tests for MessageStringCollector

The messages are usually added conditionally, which makes
it more natural to use msc.appendIf(conditional, message) as
compared to if(conditional) { msc.append(message); }.

Also adds tests for basic functionality of the class and
renames the files according to conventions.

Refs #3886
src/gromacs/mdlib/updategroups.cpp
src/gromacs/selection/selectionoption.cpp
src/gromacs/utility.h
src/gromacs/utility/message_string_collector.cpp [moved from src/gromacs/utility/messagestringcollector.cpp with 90% similarity]
src/gromacs/utility/message_string_collector.h [moved from src/gromacs/utility/messagestringcollector.h with 92% similarity]
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/message_string_collector.cpp [new file with mode: 0644]