Commit 6a26e47c by Gennadiy Civil

Code merge, upstreaming accumulated changes, cleanup

parent 62dbaa29
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
// //
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
// //
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
...@@ -79,7 +80,7 @@ TEST_P(FooTest, HasBlahBlah) { ...@@ -79,7 +80,7 @@ TEST_P(FooTest, HasBlahBlah) {
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// case with any set of parameters you want. Google Test defines a number // case with any set of parameters you want. Google Test defines a number
// of functions for generating test parameters. They return what we call // of functions for generating test parameters. They return what we call
// (surprise!) parameter generators. Here is a summary of them, which // (surprise!) parameter generators. Here is a summary of them, which
// are all in the testing namespace: // are all in the testing namespace:
// //
// //
...@@ -268,7 +269,7 @@ internal::ParamGenerator<T> Range(T start, T end) { ...@@ -268,7 +269,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
// each with C-string values of "foo", "bar", and "baz": // each with C-string values of "foo", "bar", and "baz":
// //
// const char* strings[] = {"foo", "bar", "baz"}; // const char* strings[] = {"foo", "bar", "baz"};
// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); // INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
// //
// This instantiates tests from test case StlStringTest // This instantiates tests from test case StlStringTest
// each with STL strings with values "a" and "b": // each with STL strings with values "a" and "b":
...@@ -1413,24 +1414,26 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3, ...@@ -1413,24 +1414,26 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
// alphanumeric characters or underscore. Because PrintToString adds quotes // alphanumeric characters or underscore. Because PrintToString adds quotes
// to std::string and C strings, it won't work for these types. // to std::string and C strings, it won't work for these types.
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \ #define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
static ::testing::internal::ParamGenerator<test_case_name::ParamType> \ static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ gtest_##prefix##test_case_name##_EvalGenerator_() { \
static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \ return generator; \
const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \ } \
return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \ static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
(__VA_ARGS__)(info); \ const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
} \ return ::testing::internal::GetParamNameGen<test_case_name::ParamType>( \
__VA_ARGS__)(info); \
} \
static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ ::testing::UnitTest::GetInstance() \
GetTestCasePatternHolder<test_case_name>(\ ->parameterized_test_registry() \
#test_case_name, \ .GetTestCasePatternHolder<test_case_name>( \
::testing::internal::CodeLocation(\ #test_case_name, \
__FILE__, __LINE__))->AddTestCaseInstantiation(\ ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
#prefix, \ ->AddTestCaseInstantiation( \
&gtest_##prefix##test_case_name##_EvalGenerator_, \ #prefix, &gtest_##prefix##test_case_name##_EvalGenerator_, \
&gtest_##prefix##test_case_name##_EvalGenerateName_, \ &gtest_##prefix##test_case_name##_EvalGenerateName_, __FILE__, \
__FILE__, __LINE__) __LINE__)
} // namespace testing } // namespace testing
......
...@@ -78,7 +78,7 @@ TEST_P(FooTest, HasBlahBlah) { ...@@ -78,7 +78,7 @@ TEST_P(FooTest, HasBlahBlah) {
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// case with any set of parameters you want. Google Test defines a number // case with any set of parameters you want. Google Test defines a number
// of functions for generating test parameters. They return what we call // of functions for generating test parameters. They return what we call
// (surprise!) parameter generators. Here is a summary of them, which // (surprise!) parameter generators. Here is a summary of them, which
// are all in the testing namespace: // are all in the testing namespace:
// //
// //
...@@ -267,7 +267,7 @@ internal::ParamGenerator<T> Range(T start, T end) { ...@@ -267,7 +267,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
// each with C-string values of "foo", "bar", and "baz": // each with C-string values of "foo", "bar", and "baz":
// //
// const char* strings[] = {"foo", "bar", "baz"}; // const char* strings[] = {"foo", "bar", "baz"};
// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); // INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
// //
// This instantiates tests from test case StlStringTest // This instantiates tests from test case StlStringTest
// each with STL strings with values "a" and "b": // each with STL strings with values "a" and "b":
......
...@@ -243,7 +243,7 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); ...@@ -243,7 +243,7 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
} \ } \
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \ static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
GTEST_ATTRIBUTE_UNUSED_ = \ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \
__FILE__, __LINE__, #__VA_ARGS__) __FILE__, __LINE__, #__VA_ARGS__)
// The 'Types' template argument below must have spaces around it // The 'Types' template argument below must have spaces around it
......
...@@ -160,7 +160,7 @@ $for k [[ ...@@ -160,7 +160,7 @@ $for k [[
virtual ParamIteratorInterface<ParamType>* Clone() const { virtual ParamIteratorInterface<ParamType>* Clone() const {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return &current_value_; } virtual const ParamType* Current() const { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
...@@ -192,7 +192,7 @@ $for k [[ ...@@ -192,7 +192,7 @@ $for k [[
void ComputeCurrentValue() { void ComputeCurrentValue() {
if (!AtEnd()) if (!AtEnd())
current_value_ = ParamType($for j, [[*current$(j)_]]); current_value_.reset(new ParamType($for j, [[*current$(j)_]]));
} }
bool AtEnd() const { bool AtEnd() const {
// We must report iterator past the end of the range when either of the // We must report iterator past the end of the range when either of the
...@@ -217,7 +217,7 @@ $for j [[ ...@@ -217,7 +217,7 @@ $for j [[
typename ParamGenerator<T$j>::iterator current$(j)_; typename ParamGenerator<T$j>::iterator current$(j)_;
]] ]]
ParamType current_value_; linked_ptr<ParamType> current_value_;
}; // class CartesianProductGenerator$i::Iterator }; // class CartesianProductGenerator$i::Iterator
// No implementation - assignment is unsupported. // No implementation - assignment is unsupported.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment