Add unit tests for ArrayRef
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 18 Mar 2015 08:52:15 +0000 (08:52 +0000)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 16 Jun 2015 09:06:45 +0000 (11:06 +0200)
commitb31a7c6eef286cbecebdafb8420c5b410d86925b
tree2e49d014afa49cd1236bbd65761243f9ddcd6209
parent37de87dbb3f06d617668f65fd1da0026dd32023f
Add unit tests for ArrayRef

This fixes mdrun signalling on BG/Q. The templated constructor for
ArrayRef does not work with xlc 12 on BG/Q with array fields of
structs unless the base type has size equal to char. Presumably this
is another example of the way that attributes of struct fields just
get thrown away by compilers.

Changed name of local variable to sig, just in case "signal" clashes
with a preprocessor symbol somewhere...

Some changes to the arrayref.h implementation to make it easier to
write the tests as type-parameterized, by making the factory functions
also appear as members of the corresponding classes, with the same
name for both ArrayRef and ConstArrayRef. While there, remove some
documentation duplication.

Fixes #1701

Change-Id: I6894706b224dc5f3db7893503371107f1ff324d2
src/gromacs/mdlib/mdrun_signalling.cpp
src/gromacs/mdlib/mdrun_signalling.h
src/gromacs/utility/arrayref.h
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/arrayref.cpp [new file with mode: 0644]