diff options
Diffstat (limited to 'googletest/include/gtest/gtest-param-test.h.pump')
-rw-r--r-- | googletest/include/gtest/gtest-param-test.h.pump | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/googletest/include/gtest/gtest-param-test.h.pump b/googletest/include/gtest/gtest-param-test.h.pump index 274f2b3..bb848ec 100644 --- a/googletest/include/gtest/gtest-param-test.h.pump +++ b/googletest/include/gtest/gtest-param-test.h.pump @@ -335,19 +335,12 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn( // // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); // -// Currently, Values() supports from 1 to $n parameters. // -$range i 1..n -$for i [[ -$range j 1..i - -template <$for j, [[typename T$j]]> -internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) { - return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]); +template <typename... T> +internal::ValueArray<T...> Values(T... v) { + return internal::ValueArray<T...>(std::move(v)...); } -]] - // Bool() allows generating tests with parameters in a set of (false, true). // // Synopsis: @@ -372,7 +365,6 @@ inline internal::ParamGenerator<bool> Bool() { return Values(false, true); } -# if GTEST_HAS_COMBINE // Combine() allows the user to combine two or more sequences to produce // values of a Cartesian product of those sequences' elements. // @@ -381,12 +373,10 @@ inline internal::ParamGenerator<bool> Bool() { // - returns a generator producing sequences with elements coming from // the Cartesian product of elements from the sequences generated by // gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types +// std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types // of elements from sequences produces by gen1, gen2, ..., genN. // -// Combine can have up to $maxtuple arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. +// Combine can have up to $maxtuple arguments. // // Example: // @@ -396,7 +386,7 @@ inline internal::ParamGenerator<bool> Bool() { // // enum Color { BLACK, GRAY, WHITE }; // class AnimalTest -// : public testing::TestWithParam<tuple<const char*, Color> > {...}; +// : public testing::TestWithParam<std::tuple<const char*, Color> > {...}; // // TEST_P(AnimalTest, AnimalLooksNice) {...} // @@ -408,10 +398,10 @@ inline internal::ParamGenerator<bool> Bool() { // Boolean flags: // // class FlagDependentTest -// : public testing::TestWithParam<tuple<bool, bool> > { +// : public testing::TestWithParam<std::tuple<bool, bool> > { // virtual void SetUp() { // // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); +// std::tie(external_flag_1, external_flag_2) = GetParam(); // } // }; // @@ -433,7 +423,6 @@ internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine( } ]] -# endif // GTEST_HAS_COMBINE # define TEST_P(test_case_name, test_name) \ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |