Loosen gmxapi stopsignaler test
commitb0ad9f303252a3abe590aab5ebec6612c1661273
authorPascal Merz <pascal.merz@me.com>
Tue, 25 Feb 2020 07:15:45 +0000 (25 00:15 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 27 Feb 2020 14:20:19 +0000 (27 15:20 +0100)
tree4fb21bab18729bfb17699cad4cf89aca985de69a
parentdad5f85782dff0bda225cbcf8a5e9266efd33d8e
Loosen gmxapi stopsignaler test

Gmxapi stopsignaler test was checking whether simulations were stopped
on the step after a stop signal was set. This is true for the legacy
implementation, but only due to the exact order of instructions. The
StopSignalHandler does not guarantee to stop simulations at the next
NS step after a signal has been set, it promises to stop a simulation
at the next NS step after a signal has been communicated. This change
loosens the criterion to reflect this.

Further, this change
* Changes the numberOfTimesCalled() function to timeElapsedSinceStart(),
  also including a different treatment of the call before the restraint
  is ever called, to avoid misunderstandings.
* Adds a comment to explain the expectations validated by this test.

Fixes #3397

Change-Id: I2a3805a14c03d0ee12ebd21b5863c5243b1c3671
src/api/cpp/tests/stopsignaler.cpp