make WithParamInterface<T>::GetParam static

Signed-off-by: Matthias Räncker <theonetruecamper@gmx.de>
This commit is contained in:
Matthias Räncker 2018-09-12 17:42:45 +02:00
parent 4d066127be
commit d830440d48
No known key found for this signature in database
GPG Key ID: 158B83B057294FF2

View File

@ -1798,11 +1798,8 @@ class WithParamInterface {
virtual ~WithParamInterface() {}
// The current parameter value. Is also available in the test fixture's
// constructor. This member function is non-static, even though it only
// references static data, to reduce the opportunity for incorrect uses
// like writing 'WithParamInterface<bool>::GetParam()' for a test that
// uses a fixture whose parameter type is int.
const ParamType& GetParam() const {
// constructor.
static const ParamType& GetParam() {
GTEST_CHECK_(parameter_ != NULL)
<< "GetParam() can only be called inside a value-parameterized test "
<< "-- did you intend to write TEST_P instead of TEST_F?";