summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal
diff options
context:
space:
mode:
authormisterg <misterg@google.com>2019-02-04 18:03:10 (GMT)
committerGennadiy Civil <misterg@google.com>2019-02-04 19:19:58 (GMT)
commit50059a12b9fdcd4d8d7b5e5670474225daf31ed3 (patch)
tree9aaa90b55f291a787928aebec6dddafe16df9f58 /googletest/include/gtest/internal
parent52ea4f7beaa6e05a52ded6b04a73b7eadbc09996 (diff)
downloadgoogletest-50059a12b9fdcd4d8d7b5e5670474225daf31ed3.zip
googletest-50059a12b9fdcd4d8d7b5e5670474225daf31ed3.tar.gz
googletest-50059a12b9fdcd4d8d7b5e5670474225daf31ed3.tar.bz2
Googletest export
Address -Wgnu-zero-variadic-macro-arguments Originally in OSS PR #2063 https://github.com/google/googletest/pull/2063 Fix regression in INSTANTIATE_TEST_SUITE_P macro to accept function pointers properly. PiperOrigin-RevId: 232316698
Diffstat (limited to 'googletest/include/gtest/internal')
-rw-r--r--googletest/include/gtest/internal/gtest-param-util.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/googletest/include/gtest/internal/gtest-param-util.h b/googletest/include/gtest/internal/gtest-param-util.h
index bca7253..36469dd 100644
--- a/googletest/include/gtest/internal/gtest-param-util.h
+++ b/googletest/include/gtest/internal/gtest-param-util.h
@@ -376,25 +376,12 @@ std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
return name_stream.GetString();
}
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Parameterized test name overload helpers, which help the
-// INSTANTIATE_TEST_SUITE_P macro choose between the default parameterized
-// test name generator and user param name generator.
-template <class ParamType, class ParamNameGenFunctor>
-ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
- return func;
-}
-
-template <class ParamType>
-struct ParamNameGenFunc {
- typedef std::string Type(const TestParamInfo<ParamType>&);
-};
-
-template <class ParamType>
-typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
- return DefaultParamName;
+template <typename T = int>
+void TestNotEmpty() {
+ static_assert(sizeof(T) == 0, "Empty arguments are not allowed.");
}
+template <typename T = int>
+void TestNotEmpty(const T&) {}
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
@@ -500,7 +487,7 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
using ParamType = typename TestSuite::ParamType;
// A function that returns an instance of appropriate generator type.
typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
- typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
+ using ParamNameGeneratorFunc = std::string(const TestParamInfo<ParamType>&);
explicit ParameterizedTestSuiteInfo(const char* name,
CodeLocation code_location)