From d830440d48a9502161448bc78be33a53388dd1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20R=C3=A4ncker?= Date: Wed, 12 Sep 2018 17:42:45 +0200 Subject: [PATCH] make WithParamInterface::GetParam static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Räncker --- googletest/include/gtest/gtest.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index 5df4b0a3..3b4bb1ee 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -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::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?";