| gmock-generated-function-mockers.h | | gmock-generated-function-mockers.h | |
| | | | |
| skipping to change at line 329 | | skipping to change at line 329 | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
| // The style guide prohibits "using" statements in a namespace scope | | // The style guide prohibits "using" statements in a namespace scope | |
| // inside a header file. However, the FunctionMocker class template | | // inside a header file. However, the FunctionMocker class template | |
| // is meant to be defined in the ::testing namespace. The following | | // is meant to be defined in the ::testing namespace. The following | |
| // line is just a trick for working around a bug in MSVC 8.0, which | | // line is just a trick for working around a bug in MSVC 8.0, which | |
| // cannot handle it if we define FunctionMocker in ::testing. | | // cannot handle it if we define FunctionMocker in ::testing. | |
| using internal::FunctionMocker; | | using internal::FunctionMocker; | |
| | | | |
|
| // The result type of function type F. | | // GMOCK_RESULT_(tn, F) expands to the result type of function type F. | |
| | | // We define this as a variadic macro in case F contains unprotected | |
| | | // commas (the same reason that we use variadic macros in other places | |
| | | // in this file). | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_RESULT_(tn, F) tn ::testing::internal::Function<F>::Result | | #define GMOCK_RESULT_(tn, ...) \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::Result | |
| | | | |
|
| // The type of argument N of function type F. | | // The type of argument N of the given function type. | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_ARG_(tn, F, N) tn ::testing::internal::Function<F>::Argument# | | #define GMOCK_ARG_(tn, N, ...) \ | |
| #N | | tn ::testing::internal::Function<__VA_ARGS__>::Argument##N | |
| | | | |
|
| // The matcher type for argument N of function type F. | | // The matcher type for argument N of the given function type. | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_MATCHER_(tn, F, N) const ::testing::Matcher<GMOCK_ARG_(tn, F, | | #define GMOCK_MATCHER_(tn, N, ...) \ | |
| N)>& | | const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>& | |
| | | | |
| // The variable for mocking the given method. | | // The variable for mocking the given method. | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
| #define GMOCK_MOCKER_(arity, constness, Method) \ | | #define GMOCK_MOCKER_(arity, constness, Method) \ | |
| GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) | | GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD0_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method() constness { \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | ) constness { \ | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 0, \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 0), \ | |
| this_method_does_not_take_0_arguments); \ | | this_method_does_not_take_0_arguments); \ | |
| GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ | | return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method() constness { \ | | gmock_##Method() constness { \ | |
| GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(0, constness, Method).With(); \ | | return GMOCK_MOCKER_(0, constness, Method).With(); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(0, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD1_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1) constness { | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 1, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 1), \ | |
| this_method_does_not_take_1_argument); \ | | this_method_does_not_take_1_argument); \ | |
| GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \ | | return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1) constness { \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness | |
| | | { \ | |
| GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ | | return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(1, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD2_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2) constness { | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 2, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 2), \ | |
| this_method_does_not_take_2_arguments); \ | | this_method_does_not_take_2_arguments); \ | |
| GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2);
\ | | return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2);
\ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2) constness { \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness | |
| | | { \ | |
| GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ | | return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(2, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD3_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3) constness { | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 3, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 3), \ | |
| this_method_does_not_take_3_arguments); \ | | this_method_does_not_take_3_arguments); \ | |
| GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3); \ | | gmock_a3); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3) constness { \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness | |
| | | { \ | |
| GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3); \ | | gmock_a3); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(3, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD4_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4) constness { | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 4, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 4), \ | |
| this_method_does_not_take_4_arguments); \ | | this_method_does_not_take_4_arguments); \ | |
| GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4); \ | | gmock_a3, gmock_a4); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4) constness { \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness | |
| | | { \ | |
| GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4); \ | | gmock_a3, gmock_a4); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(4, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD5_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5) constness { | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| \ | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 5, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 5), \ | |
| this_method_does_not_take_5_arguments); \ | | this_method_does_not_take_5_arguments); \ | |
| GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5); \ | | gmock_a3, gmock_a4, gmock_a5); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5) constness { \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness | |
| | | { \ | |
| GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5); \ | | gmock_a3, gmock_a4, gmock_a5); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(5, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD6_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5, \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_ARG_(tn, F, 6) gmock_a6) constness { | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| \ | | GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 6, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 6), \ | |
| this_method_does_not_take_6_arguments); \ | | this_method_does_not_take_6_arguments); \ | |
| GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5, \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_MATCHER_(tn, F, 6) gmock_a6) constness { \ | | GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness | |
| | | { \ | |
| GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(6, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD7_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5, \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_ARG_(tn, F, 6) gmock_a6, \ | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_ARG_(tn, F, 7) gmock_a7) constness { | | GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| \ | | GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 7, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 7), \ | |
| this_method_does_not_take_7_arguments); \ | | this_method_does_not_take_7_arguments); \ | |
| GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5, \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_MATCHER_(tn, F, 6) gmock_a6, \ | | GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_MATCHER_(tn, F, 7) gmock_a7) constness { \ | | GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness | |
| | | { \ | |
| GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(7, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD8_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5, \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_ARG_(tn, F, 6) gmock_a6, \ | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_ARG_(tn, F, 7) gmock_a7, \ | | GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_ARG_(tn, F, 8) gmock_a8) constness { | | GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| \ | | GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 8, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 8), \ | |
| this_method_does_not_take_8_arguments); \ | | this_method_does_not_take_8_arguments); \ | |
| GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5, \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_MATCHER_(tn, F, 6) gmock_a6, \ | | GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_MATCHER_(tn, F, 7) gmock_a7, \ | | GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| GMOCK_MATCHER_(tn, F, 8) gmock_a8) constness { \ | | GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness | |
| | | { \ | |
| GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(8, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD9_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5, \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_ARG_(tn, F, 6) gmock_a6, \ | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_ARG_(tn, F, 7) gmock_a7, \ | | GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_ARG_(tn, F, 8) gmock_a8, \ | | GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| GMOCK_ARG_(tn, F, 9) gmock_a9) constness { | | GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ | |
| \ | | GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 9, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 9), \ | |
| this_method_does_not_take_9_arguments); \ | | this_method_does_not_take_9_arguments); \ | |
| GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ | |
| gmock_a9); \ | | gmock_a9); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5, \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_MATCHER_(tn, F, 6) gmock_a6, \ | | GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_MATCHER_(tn, F, 7) gmock_a7, \ | | GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| GMOCK_MATCHER_(tn, F, 8) gmock_a8, \ | | GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ | |
| GMOCK_MATCHER_(tn, F, 9) gmock_a9) constness { \ | | GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness | |
| | | { \ | |
| GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ | |
| gmock_a9); \ | | gmock_a9); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(9, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness | |
| | | , \ | |
| | | Method) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | | // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! | |
|
| #define GMOCK_METHOD10_(tn, constness, ct, Method, F) \ | | #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ | |
| GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \ | | GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ | |
| GMOCK_ARG_(tn, F, 2) gmock_a2, \ | | GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_ARG_(tn, F, 3) gmock_a3, \ | | GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_ARG_(tn, F, 4) gmock_a4, \ | | GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_ARG_(tn, F, 5) gmock_a5, \ | | GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_ARG_(tn, F, 6) gmock_a6, \ | | GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_ARG_(tn, F, 7) gmock_a7, \ | | GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_ARG_(tn, F, 8) gmock_a8, \ | | GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| GMOCK_ARG_(tn, F, 9) gmock_a9, \ | | GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ | |
| GMOCK_ARG_(tn, F, 10) gmock_a10) constness | | GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ | |
| { \ | | GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ | |
| GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \ | | GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< | |
| tn ::testing::internal::Function<F>::ArgumentTuple>::value == 10, \ | | \ | |
| | | tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::valu | |
| | | e \ | |
| | | == 10), \ | |
| this_method_does_not_take_10_arguments); \ | | this_method_does_not_take_10_arguments); \ | |
| GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ | | GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ | |
| return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2,
\ | | return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2,
\ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a
9, \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a
9, \ | |
| gmock_a10); \ | | gmock_a10); \ | |
| } \ | | } \ | |
|
| ::testing::MockSpec<F>& \ | | ::testing::MockSpec<__VA_ARGS__>& \ | |
| gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \ | | gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ | |
| GMOCK_MATCHER_(tn, F, 2) gmock_a2, \ | | GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ | |
| GMOCK_MATCHER_(tn, F, 3) gmock_a3, \ | | GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ | |
| GMOCK_MATCHER_(tn, F, 4) gmock_a4, \ | | GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ | |
| GMOCK_MATCHER_(tn, F, 5) gmock_a5, \ | | GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ | |
| GMOCK_MATCHER_(tn, F, 6) gmock_a6, \ | | GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ | |
| GMOCK_MATCHER_(tn, F, 7) gmock_a7, \ | | GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ | |
| GMOCK_MATCHER_(tn, F, 8) gmock_a8, \ | | GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ | |
| GMOCK_MATCHER_(tn, F, 9) gmock_a9, \ | | GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ | |
| GMOCK_MATCHER_(tn, F, 10) gmock_a10) constness { \ | | GMOCK_MATCHER_(tn, 10, \ | |
| | | __VA_ARGS__) gmock_a10) constness { \ | |
| GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ | | GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ | |
| return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ | | return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ | |
| gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a
9, \ | | gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a
9, \ | |
| gmock_a10); \ | | gmock_a10); \ | |
| } \ | | } \ | |
|
| mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(10, constness, Method) | | mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constnes | |
| | | s, \ | |
| | | Method) | |
| | | | |
|
| #define MOCK_METHOD0(m, F) GMOCK_METHOD0_(, , , m, F) | | #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD1(m, F) GMOCK_METHOD1_(, , , m, F) | | #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD2(m, F) GMOCK_METHOD2_(, , , m, F) | | #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD3(m, F) GMOCK_METHOD3_(, , , m, F) | | #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD4(m, F) GMOCK_METHOD4_(, , , m, F) | | #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD5(m, F) GMOCK_METHOD5_(, , , m, F) | | #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD6(m, F) GMOCK_METHOD6_(, , , m, F) | | #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD7(m, F) GMOCK_METHOD7_(, , , m, F) | | #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD8(m, F) GMOCK_METHOD8_(, , , m, F) | | #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD9(m, F) GMOCK_METHOD9_(, , , m, F) | | #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__) | |
| #define MOCK_METHOD10(m, F) GMOCK_METHOD10_(, , , m, F) | | #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__) | |
| | | | |
| #define MOCK_CONST_METHOD0(m, F) GMOCK_METHOD0_(, const, , m, F) | | #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__ | |
| #define MOCK_CONST_METHOD1(m, F) GMOCK_METHOD1_(, const, , m, F) | | ) | |
| #define MOCK_CONST_METHOD2(m, F) GMOCK_METHOD2_(, const, , m, F) | | #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__ | |
| #define MOCK_CONST_METHOD3(m, F) GMOCK_METHOD3_(, const, , m, F) | | ) | |
| #define MOCK_CONST_METHOD4(m, F) GMOCK_METHOD4_(, const, , m, F) | | #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__ | |
| #define MOCK_CONST_METHOD5(m, F) GMOCK_METHOD5_(, const, , m, F) | | ) | |
| #define MOCK_CONST_METHOD6(m, F) GMOCK_METHOD6_(, const, , m, F) | | #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__ | |
| #define MOCK_CONST_METHOD7(m, F) GMOCK_METHOD7_(, const, , m, F) | | ) | |
| #define MOCK_CONST_METHOD8(m, F) GMOCK_METHOD8_(, const, , m, F) | | #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__ | |
| #define MOCK_CONST_METHOD9(m, F) GMOCK_METHOD9_(, const, , m, F) | | ) | |
| #define MOCK_CONST_METHOD10(m, F) GMOCK_METHOD10_(, const, , m, F) | | #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__ | |
| | | ) | |
| #define MOCK_METHOD0_T(m, F) GMOCK_METHOD0_(typename, , , m, F) | | #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__ | |
| #define MOCK_METHOD1_T(m, F) GMOCK_METHOD1_(typename, , , m, F) | | ) | |
| #define MOCK_METHOD2_T(m, F) GMOCK_METHOD2_(typename, , , m, F) | | #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__ | |
| #define MOCK_METHOD3_T(m, F) GMOCK_METHOD3_(typename, , , m, F) | | ) | |
| #define MOCK_METHOD4_T(m, F) GMOCK_METHOD4_(typename, , , m, F) | | #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__ | |
| #define MOCK_METHOD5_T(m, F) GMOCK_METHOD5_(typename, , , m, F) | | ) | |
| #define MOCK_METHOD6_T(m, F) GMOCK_METHOD6_(typename, , , m, F) | | #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__ | |
| #define MOCK_METHOD7_T(m, F) GMOCK_METHOD7_(typename, , , m, F) | | ) | |
| #define MOCK_METHOD8_T(m, F) GMOCK_METHOD8_(typename, , , m, F) | | #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS | |
| #define MOCK_METHOD9_T(m, F) GMOCK_METHOD9_(typename, , , m, F) | | __) | |
| #define MOCK_METHOD10_T(m, F) GMOCK_METHOD10_(typename, , , m, F) | | | |
| | | #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD0_T(m, F) GMOCK_METHOD0_(typename, const, , m, F) | | #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD1_T(m, F) GMOCK_METHOD1_(typename, const, , m, F) | | #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD2_T(m, F) GMOCK_METHOD2_(typename, const, , m, F) | | #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD3_T(m, F) GMOCK_METHOD3_(typename, const, , m, F) | | #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD4_T(m, F) GMOCK_METHOD4_(typename, const, , m, F) | | #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD5_T(m, F) GMOCK_METHOD5_(typename, const, , m, F) | | #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD6_T(m, F) GMOCK_METHOD6_(typename, const, , m, F) | | #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD7_T(m, F) GMOCK_METHOD7_(typename, const, , m, F) | | #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD8_T(m, F) GMOCK_METHOD8_(typename, const, , m, F) | | #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD9_T(m, F) GMOCK_METHOD9_(typename, const, , m, F) | | #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS_ | |
| #define MOCK_CONST_METHOD10_T(m, F) GMOCK_METHOD10_(typename, const, , m, F | | _) | |
| ) | | | |
| | | #define MOCK_CONST_METHOD0_T(m, ...) \ | |
| #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD0_(, , ct, m, F) | | GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__) | |
| #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD1_(, , ct, m, F) | | #define MOCK_CONST_METHOD1_T(m, ...) \ | |
| #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD2_(, , ct, m, F) | | GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__) | |
| #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD3_(, , ct, m, F) | | #define MOCK_CONST_METHOD2_T(m, ...) \ | |
| #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD4_(, , ct, m, F) | | GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__) | |
| #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD5_(, , ct, m, F) | | #define MOCK_CONST_METHOD3_T(m, ...) \ | |
| #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD6_(, , ct, m, F) | | GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__) | |
| #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD7_(, , ct, m, F) | | #define MOCK_CONST_METHOD4_T(m, ...) \ | |
| #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD8_(, , ct, m, F) | | GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__) | |
| #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD9_(, , ct, m, F) | | #define MOCK_CONST_METHOD5_T(m, ...) \ | |
| #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD10_(, , ct, m, F) | | GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD6_T(m, ...) \ | |
| #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__) | |
| GMOCK_METHOD0_(, const, ct, m, F) | | #define MOCK_CONST_METHOD7_T(m, ...) \ | |
| #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__) | |
| GMOCK_METHOD1_(, const, ct, m, F) | | #define MOCK_CONST_METHOD8_T(m, ...) \ | |
| #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__) | |
| GMOCK_METHOD2_(, const, ct, m, F) | | #define MOCK_CONST_METHOD9_T(m, ...) \ | |
| #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__) | |
| GMOCK_METHOD3_(, const, ct, m, F) | | #define MOCK_CONST_METHOD10_T(m, ...) \ | |
| #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__) | |
| GMOCK_METHOD4_(, const, ct, m, F) | | | |
| #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD5_(, const, ct, m, F) | | GMOCK_METHOD0_(, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD6_(, const, ct, m, F) | | GMOCK_METHOD1_(, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD7_(, const, ct, m, F) | | GMOCK_METHOD2_(, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD8_(, const, ct, m, F) | | GMOCK_METHOD3_(, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD9_(, const, ct, m, F) | | GMOCK_METHOD4_(, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD10_(, const, ct, m, F) | | GMOCK_METHOD5_(, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD6_(, , ct, m, __VA_ARGS__) | |
| GMOCK_METHOD0_(typename, , ct, m, F) | | #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD7_(, , ct, m, __VA_ARGS__) | |
| GMOCK_METHOD1_(typename, , ct, m, F) | | #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD8_(, , ct, m, __VA_ARGS__) | |
| GMOCK_METHOD2_(typename, , ct, m, F) | | #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD9_(, , ct, m, __VA_ARGS__) | |
| GMOCK_METHOD3_(typename, , ct, m, F) | | #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD10_(, , ct, m, __VA_ARGS__) | |
| GMOCK_METHOD4_(typename, , ct, m, F) | | | |
| #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD5_(typename, , ct, m, F) | | GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__) | |
| #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD6_(typename, , ct, m, F) | | GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__) | |
| #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD7_(typename, , ct, m, F) | | GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__) | |
| #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD8_(typename, , ct, m, F) | | GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__) | |
| #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD9_(typename, , ct, m, F) | | GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__) | |
| #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD10_(typename, , ct, m, F) | | GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__) | |
| GMOCK_METHOD0_(typename, const, ct, m, F) | | #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__) | |
| GMOCK_METHOD1_(typename, const, ct, m, F) | | #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__) | |
| GMOCK_METHOD2_(typename, const, ct, m, F) | | #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__) | |
| GMOCK_METHOD3_(typename, const, ct, m, F) | | #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ | |
| #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, F) \ | | GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__) | |
| GMOCK_METHOD4_(typename, const, ct, m, F) | | | |
| #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD5_(typename, const, ct, m, F) | | GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD6_(typename, const, ct, m, F) | | GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD7_(typename, const, ct, m, F) | | GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD8_(typename, const, ct, m, F) | | GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD9_(typename, const, ct, m, F) | | GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__) | |
| #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, F) \ | | #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ | |
| GMOCK_METHOD10_(typename, const, ct, m, F) | | GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__) | |
| | | #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__) | |
| | | | |
| | | #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__) | |
| | | #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ | |
| | | GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__) | |
| | | | |
| // A MockFunction<F> class has one mock method whose type is F. It is | | // A MockFunction<F> class has one mock method whose type is F. It is | |
| // useful when you just want your test code to emit some messages and | | // useful when you just want your test code to emit some messages and | |
| // have Google Mock verify the right messages are sent (and perhaps at | | // have Google Mock verify the right messages are sent (and perhaps at | |
| // the right times). For example, if you are exercising code: | | // the right times). For example, if you are exercising code: | |
| // | | // | |
| // Foo(1); | | // Foo(1); | |
| // Foo(2); | | // Foo(2); | |
| // Foo(3); | | // Foo(3); | |
| // | | // | |
| | | | |
End of changes. 40 change blocks. |
| 313 lines changed or deleted | | 416 lines changed or added | |
|
| gmock-generated-matchers.h | | gmock-generated-matchers.h | |
| | | | |
| skipping to change at line 41 | | skipping to change at line 41 | |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| | | | |
| // Google Mock - a framework for writing C++ mock classes. | | // Google Mock - a framework for writing C++ mock classes. | |
| // | | // | |
| // This file implements some commonly used variadic matchers. | | // This file implements some commonly used variadic matchers. | |
| | | | |
| #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | | #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | |
| #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | | #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | |
| | | | |
|
| | | #include <iterator> | |
| #include <sstream> | | #include <sstream> | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| #include "gmock/gmock-matchers.h" | | #include "gmock/gmock-matchers.h" | |
| | | | |
| namespace testing { | | namespace testing { | |
| namespace internal { | | namespace internal { | |
| | | | |
| // The type of the i-th (0-based) field of Tuple. | | // The type of the i-th (0-based) field of Tuple. | |
| #define GMOCK_FIELD_TYPE_(Tuple, i) \ | | #define GMOCK_FIELD_TYPE_(Tuple, i) \ | |
| | | | |
| skipping to change at line 308 | | skipping to change at line 309 | |
| return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k
5, | | return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k
5, | |
| k6, k7, k8, k9>(inner_matcher_)); | | k6, k7, k8, k9>(inner_matcher_)); | |
| } | | } | |
| | | | |
| private: | | private: | |
| const InnerMatcher inner_matcher_; | | const InnerMatcher inner_matcher_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ArgsMatcher); | | GTEST_DISALLOW_ASSIGN_(ArgsMatcher); | |
| }; | | }; | |
| | | | |
|
| // Implements ElementsAre() of 1-10 arguments. | | // A set of metafunctions for computing the result type of AllOf. | |
| | | // AllOf(m1, ..., mN) returns | |
| template <typename T1> | | // AllOfResultN<decltype(m1), ..., decltype(mN)>::type. | |
| class ElementsAreMatcher1 { | | | |
| public: | | // Although AllOf isn't defined for one argument, AllOfResult1 is defined | |
| explicit ElementsAreMatcher1(const T1& e1) : e1_(e1) {} | | // to simplify the implementation. | |
| | | template <typename M1> | |
| template <typename Container> | | struct AllOfResult1 { | |
| operator Matcher<Container>() const { | | typedef M1 type; | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | }; | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | template <typename M1, typename M2> | |
| Element; | | struct AllOfResult2 { | |
| | | typedef BothOfMatcher< | |
| // Nokia's Symbian Compiler has a nasty bug where the object put | | typename AllOfResult1<M1>::type, | |
| // in a one-element local array is not destructed when the array | | typename AllOfResult1<M2>::type | |
| // goes out of scope. This leads to obvious badness as we've | | > type; | |
| // added the linked_ptr in it to our other linked_ptrs list. | | }; | |
| // Hence we implement ElementsAreMatcher1 specially to avoid using | | | |
| // a local array. | | template <typename M1, typename M2, typename M3> | |
| const Matcher<const Element&> matcher = | | struct AllOfResult3 { | |
| MatcherCast<const Element&>(e1_); | | typedef BothOfMatcher< | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(&matcher, 1)); | | typename AllOfResult1<M1>::type, | |
| } | | typename AllOfResult2<M2, M3>::type | |
| | | > type; | |
| private: | | }; | |
| const T1& e1_; | | | |
| | | template <typename M1, typename M2, typename M3, typename M4> | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher1); | | struct AllOfResult4 { | |
| }; | | typedef BothOfMatcher< | |
| | | typename AllOfResult2<M1, M2>::type, | |
| template <typename T1, typename T2> | | typename AllOfResult2<M3, M4>::type | |
| class ElementsAreMatcher2 { | | > type; | |
| public: | | }; | |
| ElementsAreMatcher2(const T1& e1, const T2& e2) : e1_(e1), e2_(e2) {} | | | |
| | | template <typename M1, typename M2, typename M3, typename M4, typename M5> | |
| template <typename Container> | | struct AllOfResult5 { | |
| operator Matcher<Container>() const { | | typedef BothOfMatcher< | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | typename AllOfResult2<M1, M2>::type, | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | typename AllOfResult3<M3, M4, M5>::type | |
| type | | > type; | |
| Element; | | }; | |
| | | | |
| const Matcher<const Element&> matchers[] = { | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| MatcherCast<const Element&>(e1_), | | typename M6> | |
| MatcherCast<const Element&>(e2_), | | struct AllOfResult6 { | |
| }; | | typedef BothOfMatcher< | |
| | | typename AllOfResult3<M1, M2, M3>::type, | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 2)); | | typename AllOfResult3<M4, M5, M6>::type | |
| } | | > type; | |
| | | }; | |
| private: | | | |
| const T1& e1_; | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| const T2& e2_; | | typename M6, typename M7> | |
| | | struct AllOfResult7 { | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher2); | | typedef BothOfMatcher< | |
| }; | | typename AllOfResult3<M1, M2, M3>::type, | |
| | | typename AllOfResult4<M4, M5, M6, M7>::type | |
| template <typename T1, typename T2, typename T3> | | > type; | |
| class ElementsAreMatcher3 { | | }; | |
| public: | | | |
| ElementsAreMatcher3(const T1& e1, const T2& e2, const T3& e3) : e1_(e1), | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| e2_(e2), e3_(e3) {} | | typename M6, typename M7, typename M8> | |
| | | struct AllOfResult8 { | |
| template <typename Container> | | typedef BothOfMatcher< | |
| operator Matcher<Container>() const { | | typename AllOfResult4<M1, M2, M3, M4>::type, | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | typename AllOfResult4<M5, M6, M7, M8>::type | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | > type; | |
| type | | }; | |
| Element; | | | |
| | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| const Matcher<const Element&> matchers[] = { | | typename M6, typename M7, typename M8, typename M9> | |
| MatcherCast<const Element&>(e1_), | | struct AllOfResult9 { | |
| MatcherCast<const Element&>(e2_), | | typedef BothOfMatcher< | |
| MatcherCast<const Element&>(e3_), | | typename AllOfResult4<M1, M2, M3, M4>::type, | |
| }; | | typename AllOfResult5<M5, M6, M7, M8, M9>::type | |
| | | > type; | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 3)); | | }; | |
| } | | | |
| | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| private: | | typename M6, typename M7, typename M8, typename M9, typename M10> | |
| const T1& e1_; | | struct AllOfResult10 { | |
| const T2& e2_; | | typedef BothOfMatcher< | |
| const T3& e3_; | | typename AllOfResult5<M1, M2, M3, M4, M5>::type, | |
| | | typename AllOfResult5<M6, M7, M8, M9, M10>::type | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher3); | | > type; | |
| }; | | }; | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4> | | // A set of metafunctions for computing the result type of AnyOf. | |
| class ElementsAreMatcher4 { | | // AnyOf(m1, ..., mN) returns | |
| public: | | // AnyOfResultN<decltype(m1), ..., decltype(mN)>::type. | |
| ElementsAreMatcher4(const T1& e1, const T2& e2, const T3& e3, | | | |
| const T4& e4) : e1_(e1), e2_(e2), e3_(e3), e4_(e4) {} | | // Although AnyOf isn't defined for one argument, AnyOfResult1 is defined | |
| | | // to simplify the implementation. | |
| template <typename Container> | | template <typename M1> | |
| operator Matcher<Container>() const { | | struct AnyOfResult1 { | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | typedef M1 type; | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | }; | |
| type | | | |
| Element; | | template <typename M1, typename M2> | |
| | | struct AnyOfResult2 { | |
| const Matcher<const Element&> matchers[] = { | | typedef EitherOfMatcher< | |
| MatcherCast<const Element&>(e1_), | | typename AnyOfResult1<M1>::type, | |
| MatcherCast<const Element&>(e2_), | | typename AnyOfResult1<M2>::type | |
| MatcherCast<const Element&>(e3_), | | > type; | |
| MatcherCast<const Element&>(e4_), | | }; | |
| }; | | | |
| | | template <typename M1, typename M2, typename M3> | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 4)); | | struct AnyOfResult3 { | |
| } | | typedef EitherOfMatcher< | |
| | | typename AnyOfResult1<M1>::type, | |
| private: | | typename AnyOfResult2<M2, M3>::type | |
| const T1& e1_; | | > type; | |
| const T2& e2_; | | }; | |
| const T3& e3_; | | | |
| const T4& e4_; | | template <typename M1, typename M2, typename M3, typename M4> | |
| | | struct AnyOfResult4 { | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher4); | | typedef EitherOfMatcher< | |
| }; | | typename AnyOfResult2<M1, M2>::type, | |
| | | typename AnyOfResult2<M3, M4>::type | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5> | | > type; | |
| class ElementsAreMatcher5 { | | }; | |
| public: | | | |
| ElementsAreMatcher5(const T1& e1, const T2& e2, const T3& e3, const T4& e | | template <typename M1, typename M2, typename M3, typename M4, typename M5> | |
| 4, | | struct AnyOfResult5 { | |
| const T5& e5) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5) {} | | typedef EitherOfMatcher< | |
| | | typename AnyOfResult2<M1, M2>::type, | |
| template <typename Container> | | typename AnyOfResult3<M3, M4, M5>::type | |
| operator Matcher<Container>() const { | | > type; | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | }; | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| Element; | | typename M6> | |
| | | struct AnyOfResult6 { | |
| const Matcher<const Element&> matchers[] = { | | typedef EitherOfMatcher< | |
| MatcherCast<const Element&>(e1_), | | typename AnyOfResult3<M1, M2, M3>::type, | |
| MatcherCast<const Element&>(e2_), | | typename AnyOfResult3<M4, M5, M6>::type | |
| MatcherCast<const Element&>(e3_), | | > type; | |
| MatcherCast<const Element&>(e4_), | | }; | |
| MatcherCast<const Element&>(e5_), | | | |
| }; | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| | | typename M6, typename M7> | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 5)); | | struct AnyOfResult7 { | |
| } | | typedef EitherOfMatcher< | |
| | | typename AnyOfResult3<M1, M2, M3>::type, | |
| private: | | typename AnyOfResult4<M4, M5, M6, M7>::type | |
| const T1& e1_; | | > type; | |
| const T2& e2_; | | }; | |
| const T3& e3_; | | | |
| const T4& e4_; | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| const T5& e5_; | | typename M6, typename M7, typename M8> | |
| | | struct AnyOfResult8 { | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher5); | | typedef EitherOfMatcher< | |
| }; | | typename AnyOfResult4<M1, M2, M3, M4>::type, | |
| | | typename AnyOfResult4<M5, M6, M7, M8>::type | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | > type; | |
| typename T6> | | }; | |
| class ElementsAreMatcher6 { | | | |
| public: | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| ElementsAreMatcher6(const T1& e1, const T2& e2, const T3& e3, const T4& e | | typename M6, typename M7, typename M8, typename M9> | |
| 4, | | struct AnyOfResult9 { | |
| const T5& e5, const T6& e6) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), | | typedef EitherOfMatcher< | |
| e5_(e5), e6_(e6) {} | | typename AnyOfResult4<M1, M2, M3, M4>::type, | |
| | | typename AnyOfResult5<M5, M6, M7, M8, M9>::type | |
| template <typename Container> | | > type; | |
| operator Matcher<Container>() const { | | }; | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| type | | typename M6, typename M7, typename M8, typename M9, typename M10> | |
| Element; | | struct AnyOfResult10 { | |
| | | typedef EitherOfMatcher< | |
| const Matcher<const Element&> matchers[] = { | | typename AnyOfResult5<M1, M2, M3, M4, M5>::type, | |
| MatcherCast<const Element&>(e1_), | | typename AnyOfResult5<M6, M7, M8, M9, M10>::type | |
| MatcherCast<const Element&>(e2_), | | > type; | |
| MatcherCast<const Element&>(e3_), | | | |
| MatcherCast<const Element&>(e4_), | | | |
| MatcherCast<const Element&>(e5_), | | | |
| MatcherCast<const Element&>(e6_), | | | |
| }; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 6)); | | | |
| } | | | |
| | | | |
| private: | | | |
| const T1& e1_; | | | |
| const T2& e2_; | | | |
| const T3& e3_; | | | |
| const T4& e4_; | | | |
| const T5& e5_; | | | |
| const T6& e6_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher6); | | | |
| }; | | | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | | |
| typename T6, typename T7> | | | |
| class ElementsAreMatcher7 { | | | |
| public: | | | |
| ElementsAreMatcher7(const T1& e1, const T2& e2, const T3& e3, const T4& e | | | |
| 4, | | | |
| const T5& e5, const T6& e6, const T7& e7) : e1_(e1), e2_(e2), e3_(e3) | | | |
| , | | | |
| e4_(e4), e5_(e5), e6_(e6), e7_(e7) {} | | | |
| | | | |
| template <typename Container> | | | |
| operator Matcher<Container>() const { | | | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | | |
| Element; | | | |
| | | | |
| const Matcher<const Element&> matchers[] = { | | | |
| MatcherCast<const Element&>(e1_), | | | |
| MatcherCast<const Element&>(e2_), | | | |
| MatcherCast<const Element&>(e3_), | | | |
| MatcherCast<const Element&>(e4_), | | | |
| MatcherCast<const Element&>(e5_), | | | |
| MatcherCast<const Element&>(e6_), | | | |
| MatcherCast<const Element&>(e7_), | | | |
| }; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 7)); | | | |
| } | | | |
| | | | |
| private: | | | |
| const T1& e1_; | | | |
| const T2& e2_; | | | |
| const T3& e3_; | | | |
| const T4& e4_; | | | |
| const T5& e5_; | | | |
| const T6& e6_; | | | |
| const T7& e7_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher7); | | | |
| }; | | | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | | |
| typename T6, typename T7, typename T8> | | | |
| class ElementsAreMatcher8 { | | | |
| public: | | | |
| ElementsAreMatcher8(const T1& e1, const T2& e2, const T3& e3, const T4& e | | | |
| 4, | | | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8) : e1_(e1), | | | |
| e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6), e7_(e7), e8_(e8) {} | | | |
| | | | |
| template <typename Container> | | | |
| operator Matcher<Container>() const { | | | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | | |
| Element; | | | |
| | | | |
| const Matcher<const Element&> matchers[] = { | | | |
| MatcherCast<const Element&>(e1_), | | | |
| MatcherCast<const Element&>(e2_), | | | |
| MatcherCast<const Element&>(e3_), | | | |
| MatcherCast<const Element&>(e4_), | | | |
| MatcherCast<const Element&>(e5_), | | | |
| MatcherCast<const Element&>(e6_), | | | |
| MatcherCast<const Element&>(e7_), | | | |
| MatcherCast<const Element&>(e8_), | | | |
| }; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 8)); | | | |
| } | | | |
| | | | |
| private: | | | |
| const T1& e1_; | | | |
| const T2& e2_; | | | |
| const T3& e3_; | | | |
| const T4& e4_; | | | |
| const T5& e5_; | | | |
| const T6& e6_; | | | |
| const T7& e7_; | | | |
| const T8& e8_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher8); | | | |
| }; | | | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | | |
| typename T6, typename T7, typename T8, typename T9> | | | |
| class ElementsAreMatcher9 { | | | |
| public: | | | |
| ElementsAreMatcher9(const T1& e1, const T2& e2, const T3& e3, const T4& e | | | |
| 4, | | | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8, | | | |
| const T9& e9) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6), | | | |
| e7_(e7), e8_(e8), e9_(e9) {} | | | |
| | | | |
| template <typename Container> | | | |
| operator Matcher<Container>() const { | | | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | | |
| Element; | | | |
| | | | |
| const Matcher<const Element&> matchers[] = { | | | |
| MatcherCast<const Element&>(e1_), | | | |
| MatcherCast<const Element&>(e2_), | | | |
| MatcherCast<const Element&>(e3_), | | | |
| MatcherCast<const Element&>(e4_), | | | |
| MatcherCast<const Element&>(e5_), | | | |
| MatcherCast<const Element&>(e6_), | | | |
| MatcherCast<const Element&>(e7_), | | | |
| MatcherCast<const Element&>(e8_), | | | |
| MatcherCast<const Element&>(e9_), | | | |
| }; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 9)); | | | |
| } | | | |
| | | | |
| private: | | | |
| const T1& e1_; | | | |
| const T2& e2_; | | | |
| const T3& e3_; | | | |
| const T4& e4_; | | | |
| const T5& e5_; | | | |
| const T6& e6_; | | | |
| const T7& e7_; | | | |
| const T8& e8_; | | | |
| const T9& e9_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher9); | | | |
| }; | | | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | | |
| typename T6, typename T7, typename T8, typename T9, typename T10> | | | |
| class ElementsAreMatcher10 { | | | |
| public: | | | |
| ElementsAreMatcher10(const T1& e1, const T2& e2, const T3& e3, const T4& | | | |
| e4, | | | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, | | | |
| const T10& e10) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6 | | | |
| ), | | | |
| e7_(e7), e8_(e8), e9_(e9), e10_(e10) {} | | | |
| | | | |
| template <typename Container> | | | |
| operator Matcher<Container>() const { | | | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | | |
| type | | | |
| Element; | | | |
| | | | |
| const Matcher<const Element&> matchers[] = { | | | |
| MatcherCast<const Element&>(e1_), | | | |
| MatcherCast<const Element&>(e2_), | | | |
| MatcherCast<const Element&>(e3_), | | | |
| MatcherCast<const Element&>(e4_), | | | |
| MatcherCast<const Element&>(e5_), | | | |
| MatcherCast<const Element&>(e6_), | | | |
| MatcherCast<const Element&>(e7_), | | | |
| MatcherCast<const Element&>(e8_), | | | |
| MatcherCast<const Element&>(e9_), | | | |
| MatcherCast<const Element&>(e10_), | | | |
| }; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 10)) | | | |
| ; | | | |
| } | | | |
| | | | |
| private: | | | |
| const T1& e1_; | | | |
| const T2& e2_; | | | |
| const T3& e3_; | | | |
| const T4& e4_; | | | |
| const T5& e5_; | | | |
| const T6& e6_; | | | |
| const T7& e7_; | | | |
| const T8& e8_; | | | |
| const T9& e9_; | | | |
| const T10& e10_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher10); | | | |
| }; | | }; | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
| // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected | | // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected | |
| // fields of it matches a_matcher. C++ doesn't support default | | // fields of it matches a_matcher. C++ doesn't support default | |
| // arguments for function templates, so we have to overload it. | | // arguments for function templates, so we have to overload it. | |
| template <typename InnerMatcher> | | template <typename InnerMatcher> | |
| inline internal::ArgsMatcher<InnerMatcher> | | inline internal::ArgsMatcher<InnerMatcher> | |
| Args(const InnerMatcher& matcher) { | | Args(const InnerMatcher& matcher) { | |
| | | | |
| skipping to change at line 744 | | skipping to change at line 565 | |
| | | | |
| template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8, | | template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8, | |
| int k9, int k10, typename InnerMatcher> | | int k9, int k10, typename InnerMatcher> | |
| inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
k9, | | inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
k9, | |
| k10> | | k10> | |
| Args(const InnerMatcher& matcher) { | | Args(const InnerMatcher& matcher) { | |
| return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8
, | | return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8
, | |
| k9, k10>(matcher); | | k9, k10>(matcher); | |
| } | | } | |
| | | | |
|
| // ElementsAre(e0, e1, ..., e_n) matches an STL-style container with | | // ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with | |
| // (n + 1) elements, where the i-th element in the container must | | // n elements, where the i-th element in the container must | |
| // match the i-th argument in the list. Each argument of | | // match the i-th argument in the list. Each argument of | |
| // ElementsAre() can be either a value or a matcher. We support up to | | // ElementsAre() can be either a value or a matcher. We support up to | |
| // 10 arguments. | | // 10 arguments. | |
| // | | // | |
|
| | | // The use of DecayArray in the implementation allows ElementsAre() | |
| | | // to accept string literals, whose type is const char[N], but we | |
| | | // want to treat them as const char*. | |
| | | // | |
| // NOTE: Since ElementsAre() cares about the order of the elements, it | | // NOTE: Since ElementsAre() cares about the order of the elements, it | |
| // must not be used with containers whose elements's order is | | // must not be used with containers whose elements's order is | |
| // undefined (e.g. hash_map). | | // undefined (e.g. hash_map). | |
| | | | |
|
| inline internal::ElementsAreMatcher0 ElementsAre() { | | inline internal::ElementsAreMatcher< | |
| return internal::ElementsAreMatcher0(); | | std::tr1::tuple<> > | |
| | | ElementsAre() { | |
| | | typedef std::tr1::tuple<> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args()); | |
| } | | } | |
| | | | |
| template <typename T1> | | template <typename T1> | |
|
| inline internal::ElementsAreMatcher1<T1> ElementsAre(const T1& e1) { | | inline internal::ElementsAreMatcher< | |
| return internal::ElementsAreMatcher1<T1>(e1); | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type> > | |
| | | ElementsAre(const T1& e1) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2> | | template <typename T1, typename T2> | |
|
| inline internal::ElementsAreMatcher2<T1, T2> ElementsAre(const T1& e1, | | inline internal::ElementsAreMatcher< | |
| const T2& e2) { | | std::tr1::tuple< | |
| return internal::ElementsAreMatcher2<T1, T2>(e1, e2); | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3> | | template <typename T1, typename T2, typename T3> | |
|
| inline internal::ElementsAreMatcher3<T1, T2, T3> ElementsAre(const T1& e1, | | inline internal::ElementsAreMatcher< | |
| const T2& e2, const T3& e3) { | | std::tr1::tuple< | |
| return internal::ElementsAreMatcher3<T1, T2, T3>(e1, e2, e3); | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4> | | template <typename T1, typename T2, typename T3, typename T4> | |
|
| inline internal::ElementsAreMatcher4<T1, T2, T3, T4> ElementsAre(const T1& | | inline internal::ElementsAreMatcher< | |
| e1, | | std::tr1::tuple< | |
| const T2& e2, const T3& e3, const T4& e4) { | | typename internal::DecayArray<T1>::type, | |
| return internal::ElementsAreMatcher4<T1, T2, T3, T4>(e1, e2, e3, e4); | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5> | | template <typename T1, typename T2, typename T3, typename T4, typename T5> | |
|
| inline internal::ElementsAreMatcher5<T1, T2, T3, T4, | | inline internal::ElementsAreMatcher< | |
| T5> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5) { | | const T5& e5) { | |
|
| return internal::ElementsAreMatcher5<T1, T2, T3, T4, T5>(e1, e2, e3, e4, | | typedef std::tr1::tuple< | |
| e5); | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6> | | typename T6> | |
|
| inline internal::ElementsAreMatcher6<T1, T2, T3, T4, T5, | | inline internal::ElementsAreMatcher< | |
| T6> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5, const T6& e6) { | | const T5& e5, const T6& e6) { | |
|
| return internal::ElementsAreMatcher6<T1, T2, T3, T4, T5, T6>(e1, e2, e3, | | typedef std::tr1::tuple< | |
| e4, | | typename internal::DecayArray<T1>::type, | |
| e5, e6); | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7> | | typename T6, typename T7> | |
|
| inline internal::ElementsAreMatcher7<T1, T2, T3, T4, T5, T6, | | inline internal::ElementsAreMatcher< | |
| T7> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5, const T6& e6, const T7& e7) { | | const T5& e5, const T6& e6, const T7& e7) { | |
|
| return internal::ElementsAreMatcher7<T1, T2, T3, T4, T5, T6, T7>(e1, e2, | | typedef std::tr1::tuple< | |
| e3, | | typename internal::DecayArray<T1>::type, | |
| e4, e5, e6, e7); | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7 | |
| | | )); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8> | | typename T6, typename T7, typename T8> | |
|
| inline internal::ElementsAreMatcher8<T1, T2, T3, T4, T5, T6, T7, | | inline internal::ElementsAreMatcher< | |
| T8> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8) { | | const T5& e5, const T6& e6, const T7& e7, const T8& e8) { | |
|
| return internal::ElementsAreMatcher8<T1, T2, T3, T4, T5, T6, T7, T8>(e1, | | typedef std::tr1::tuple< | |
| e2, | | typename internal::DecayArray<T1>::type, | |
| e3, e4, e5, e6, e7, e8); | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7 | |
| | | , | |
| | | e8)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8, typename T9> | | typename T6, typename T7, typename T8, typename T9> | |
|
| inline internal::ElementsAreMatcher9<T1, T2, T3, T4, T5, T6, T7, T8, | | inline internal::ElementsAreMatcher< | |
| T9> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { | | const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { | |
|
| return internal::ElementsAreMatcher9<T1, T2, T3, T4, T5, T6, T7, T8, T9>( | | typedef std::tr1::tuple< | |
| e1, | | typename internal::DecayArray<T1>::type, | |
| e2, e3, e4, e5, e6, e7, e8, e9); | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7 | |
| | | , | |
| | | e8, e9)); | |
| } | | } | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8, typename T9, typename T10> | | typename T6, typename T7, typename T8, typename T9, typename T10> | |
|
| inline internal::ElementsAreMatcher10<T1, T2, T3, T4, T5, T6, T7, T8, T9, | | inline internal::ElementsAreMatcher< | |
| T10> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | | std::tr1::tuple< | |
| , | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type, | |
| | | typename internal::DecayArray<T10>::type> > | |
| | | ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, | |
| const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, | | const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, | |
| const T10& e10) { | | const T10& e10) { | |
|
| return internal::ElementsAreMatcher10<T1, T2, T3, T4, T5, T6, T7, T8, T9, | | typedef std::tr1::tuple< | |
| T10>(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10); | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type, | |
| | | typename internal::DecayArray<T10>::type> Args; | |
| | | return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7 | |
| | | , | |
| | | e8, e9, e10)); | |
| | | } | |
| | | | |
| | | // UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension | |
| | | // that matches n elements in any order. We support up to n=10 arguments. | |
| | | | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple<> > | |
| | | UnorderedElementsAre() { | |
| | | typedef std::tr1::tuple<> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args()); | |
| | | } | |
| | | | |
| | | template <typename T1> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type> > | |
| | | UnorderedElementsAre(const T1& e1) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2)); | |
| } | | } | |
| | | | |
|
| // ElementsAreArray(array) and ElementAreArray(array, count) are like | | template <typename T1, typename T2, typename T3> | |
| // ElementsAre(), except that they take an array of values or | | inline internal::UnorderedElementsAreMatcher< | |
| // matchers. The former form infers the size of 'array', which must | | std::tr1::tuple< | |
| // be a static C-style array. In the latter form, 'array' can either | | typename internal::DecayArray<T1>::type, | |
| // be a static array or a pointer to a dynamically created array. | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type> > | |
| template <typename T> | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) { | |
| inline internal::ElementsAreArrayMatcher<T> ElementsAreArray( | | typedef std::tr1::tuple< | |
| const T* first, size_t count) { | | typename internal::DecayArray<T1>::type, | |
| return internal::ElementsAreArrayMatcher<T>(first, count); | | typename internal::DecayArray<T2>::type, | |
| } | | typename internal::DecayArray<T3>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3)); | |
| template <typename T, size_t N> | | } | |
| inline internal::ElementsAreArrayMatcher<T> | | | |
| ElementsAreArray(const T (&array)[N]) { | | template <typename T1, typename T2, typename T3, typename T4> | |
| return internal::ElementsAreArrayMatcher<T>(array, N); | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | ) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| | | typename T6> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5, const T6& e6) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5, | |
| | | e6)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| | | typename T6, typename T7> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5, const T6& e6, const T7& e7) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5, | |
| | | e6, e7)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| | | typename T6, typename T7, typename T8> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5, const T6& e6, const T7& e7, const T8& e8) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5, | |
| | | e6, e7, e8)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| | | typename T6, typename T7, typename T8, typename T9> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5, | |
| | | e6, e7, e8, e9)); | |
| | | } | |
| | | | |
| | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| | | typename T6, typename T7, typename T8, typename T9, typename T10> | |
| | | inline internal::UnorderedElementsAreMatcher< | |
| | | std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type, | |
| | | typename internal::DecayArray<T10>::type> > | |
| | | UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4 | |
| | | , | |
| | | const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, | |
| | | const T10& e10) { | |
| | | typedef std::tr1::tuple< | |
| | | typename internal::DecayArray<T1>::type, | |
| | | typename internal::DecayArray<T2>::type, | |
| | | typename internal::DecayArray<T3>::type, | |
| | | typename internal::DecayArray<T4>::type, | |
| | | typename internal::DecayArray<T5>::type, | |
| | | typename internal::DecayArray<T6>::type, | |
| | | typename internal::DecayArray<T7>::type, | |
| | | typename internal::DecayArray<T8>::type, | |
| | | typename internal::DecayArray<T9>::type, | |
| | | typename internal::DecayArray<T10>::type> Args; | |
| | | return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e | |
| | | 5, | |
| | | e6, e7, e8, e9, e10)); | |
| } | | } | |
| | | | |
| // AllOf(m1, m2, ..., mk) matches any value that matches all of the given | | // AllOf(m1, m2, ..., mk) matches any value that matches all of the given | |
| // sub-matchers. AllOf is called fully qualified to prevent ADL from firin
g. | | // sub-matchers. AllOf is called fully qualified to prevent ADL from firin
g. | |
| | | | |
|
| template <typename Matcher1, typename Matcher2> | | template <typename M1, typename M2> | |
| inline internal::BothOfMatcher<Matcher1, Matcher2> | | inline typename internal::AllOfResult2<M1, M2>::type | |
| AllOf(Matcher1 m1, Matcher2 m2) { | | AllOf(M1 m1, M2 m2) { | |
| return internal::BothOfMatcher<Matcher1, Matcher2>(m1, m2); | | return typename internal::AllOfResult2<M1, M2>::type( | |
| } | | m1, | |
| | | m2); | |
| template <typename Matcher1, typename Matcher2, typename Matcher3> | | } | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | | |
| Matcher3> > | | template <typename M1, typename M2, typename M3> | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3) { | | inline typename internal::AllOfResult3<M1, M2, M3>::type | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3)); | | AllOf(M1 m1, M2 m2, M3 m3) { | |
| } | | return typename internal::AllOfResult3<M1, M2, M3>::type( | |
| | | m1, | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | ::testing::AllOf(m2, m3)); | |
| typename Matcher4> | | } | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | | |
| internal::BothOfMatcher<Matcher3, Matcher4> > > | | template <typename M1, typename M2, typename M3, typename M4> | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4) { | | inline typename internal::AllOfResult4<M1, M2, M3, M4>::type | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4)); | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4) { | |
| } | | return typename internal::AllOfResult4<M1, M2, M3, M4>::type( | |
| | | ::testing::AllOf(m1, m2), | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | ::testing::AllOf(m3, m4)); | |
| typename Matcher4, typename Matcher5> | | } | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | template <typename M1, typename M2, typename M3, typename M4, typename M5> | |
| Matcher5> > > > | | inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5) { | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5)); | | return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type( | |
| } | | ::testing::AllOf(m1, m2), | |
| | | ::testing::AllOf(m3, m4, m5)); | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | } | |
| typename Matcher4, typename Matcher5, typename Matcher6> | | | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | typename M6> | |
| internal::BothOfMatcher<Matcher5, Matcher6> > > > > | | inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { | |
| Matcher6 m6) { | | return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type( | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5, m6)); | | ::testing::AllOf(m1, m2, m3), | |
| } | | ::testing::AllOf(m4, m5, m6)); | |
| | | } | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| er7> | | typename M6, typename M7> | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { | |
| internal::BothOfMatcher<Matcher5, internal::BothOfMatcher<Matcher6, | | return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type( | |
| Matcher7> > > > > > | | ::testing::AllOf(m1, m2, m3), | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | ::testing::AllOf(m4, m5, m6, m7)); | |
| Matcher6 m6, Matcher7 m7) { | | } | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5, m6, m7)); | | | |
| } | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| | | typename M6, typename M7, typename M8> | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::typ | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | e | |
| er7, | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { | |
| typename Matcher8> | | return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::t | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | ype( | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | ::testing::AllOf(m1, m2, m3, m4), | |
| internal::BothOfMatcher<Matcher5, internal::BothOfMatcher<Matcher6, | | ::testing::AllOf(m5, m6, m7, m8)); | |
| internal::BothOfMatcher<Matcher7, Matcher8> > > > > > > | | } | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8) { | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5, m6, m7, m8)) | | typename M6, typename M7, typename M8, typename M9> | |
| ; | | inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>: | |
| } | | :type | |
| | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | M9>::type( | |
| er7, | | ::testing::AllOf(m1, m2, m3, m4), | |
| typename Matcher8, typename Matcher9> | | ::testing::AllOf(m5, m6, m7, m8, m9)); | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | } | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | | |
| internal::BothOfMatcher<Matcher5, internal::BothOfMatcher<Matcher6, | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| internal::BothOfMatcher<Matcher7, internal::BothOfMatcher<Matcher8, | | typename M6, typename M7, typename M8, typename M9, typename M10> | |
| Matcher9> > > > > > > > | | inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | M10>::type | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8, Matcher9 m9) { | | AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m1 | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5, m6, m7, m8, | | 0) { | |
| m9)); | | return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M | |
| } | | 9, | |
| | | M10>::type( | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | ::testing::AllOf(m1, m2, m3, m4, m5), | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | ::testing::AllOf(m6, m7, m8, m9, m10)); | |
| er7, | | | |
| typename Matcher8, typename Matcher9, typename Matcher10> | | | |
| inline internal::BothOfMatcher<Matcher1, internal::BothOfMatcher<Matcher2, | | | |
| internal::BothOfMatcher<Matcher3, internal::BothOfMatcher<Matcher4, | | | |
| internal::BothOfMatcher<Matcher5, internal::BothOfMatcher<Matcher6, | | | |
| internal::BothOfMatcher<Matcher7, internal::BothOfMatcher<Matcher8, | | | |
| internal::BothOfMatcher<Matcher9, Matcher10> > > > > > > > > | | | |
| AllOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8, Matcher9 m9, Matcher10 m10) { | | | |
| return ::testing::AllOf(m1, ::testing::AllOf(m2, m3, m4, m5, m6, m7, m8, | | | |
| m9, | | | |
| m10)); | | | |
| } | | } | |
| | | | |
| // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given | | // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given | |
| // sub-matchers. AnyOf is called fully qualified to prevent ADL from firin
g. | | // sub-matchers. AnyOf is called fully qualified to prevent ADL from firin
g. | |
| | | | |
|
| template <typename Matcher1, typename Matcher2> | | template <typename M1, typename M2> | |
| inline internal::EitherOfMatcher<Matcher1, Matcher2> | | inline typename internal::AnyOfResult2<M1, M2>::type | |
| AnyOf(Matcher1 m1, Matcher2 m2) { | | AnyOf(M1 m1, M2 m2) { | |
| return internal::EitherOfMatcher<Matcher1, Matcher2>(m1, m2); | | return typename internal::AnyOfResult2<M1, M2>::type( | |
| } | | m1, | |
| | | m2); | |
| template <typename Matcher1, typename Matcher2, typename Matcher3> | | } | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | | |
| r2, | | template <typename M1, typename M2, typename M3> | |
| Matcher3> > | | inline typename internal::AnyOfResult3<M1, M2, M3>::type | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3) { | | AnyOf(M1 m1, M2 m2, M3 m3) { | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3)); | | return typename internal::AnyOfResult3<M1, M2, M3>::type( | |
| } | | m1, | |
| | | ::testing::AnyOf(m2, m3)); | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | } | |
| typename Matcher4> | | | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | template <typename M1, typename M2, typename M3, typename M4> | |
| r2, | | inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type | |
| internal::EitherOfMatcher<Matcher3, Matcher4> > > | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) { | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4) { | | return typename internal::AnyOfResult4<M1, M2, M3, M4>::type( | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4)); | | ::testing::AnyOf(m1, m2), | |
| } | | ::testing::AnyOf(m3, m4)); | |
| | | } | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | | |
| typename Matcher4, typename Matcher5> | | template <typename M1, typename M2, typename M3, typename M4, typename M5> | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type | |
| r2, | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type( | |
| Matcher5> > > > | | ::testing::AnyOf(m1, m2), | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5) { | | ::testing::AnyOf(m3, m4, m5)); | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5)); | | } | |
| } | | | |
| | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | typename M6> | |
| typename Matcher4, typename Matcher5, typename Matcher6> | | inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { | |
| r2, | | return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type( | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | ::testing::AnyOf(m1, m2, m3), | |
| internal::EitherOfMatcher<Matcher5, Matcher6> > > > > | | ::testing::AnyOf(m4, m5, m6)); | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | } | |
| Matcher6 m6) { | | | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5, m6)); | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| } | | typename M6, typename M7> | |
| | | inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type( | |
| er7> | | ::testing::AnyOf(m1, m2, m3), | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | ::testing::AnyOf(m4, m5, m6, m7)); | |
| r2, | | } | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | | |
| internal::EitherOfMatcher<Matcher5, internal::EitherOfMatcher<Matcher6, | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| Matcher7> > > > > > | | typename M6, typename M7, typename M8> | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::typ | |
| Matcher6 m6, Matcher7 m7) { | | e | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5, m6, m7)); | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { | |
| } | | return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::t | |
| | | ype( | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | ::testing::AnyOf(m1, m2, m3, m4), | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | ::testing::AnyOf(m5, m6, m7, m8)); | |
| er7, | | } | |
| typename Matcher8> | | | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| r2, | | typename M6, typename M7, typename M8, typename M9> | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>: | |
| internal::EitherOfMatcher<Matcher5, internal::EitherOfMatcher<Matcher6, | | :type | |
| internal::EitherOfMatcher<Matcher7, Matcher8> > > > > > > | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8) { | | M9>::type( | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5, m6, m7, m8)) | | ::testing::AnyOf(m1, m2, m3, m4), | |
| ; | | ::testing::AnyOf(m5, m6, m7, m8, m9)); | |
| } | | } | |
| | | | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | template <typename M1, typename M2, typename M3, typename M4, typename M5, | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | typename M6, typename M7, typename M8, typename M9, typename M10> | |
| er7, | | inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, | |
| typename Matcher8, typename Matcher9> | | M10>::type | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m1 | |
| r2, | | 0) { | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M | |
| internal::EitherOfMatcher<Matcher5, internal::EitherOfMatcher<Matcher6, | | 9, | |
| internal::EitherOfMatcher<Matcher7, internal::EitherOfMatcher<Matcher8, | | M10>::type( | |
| Matcher9> > > > > > > > | | ::testing::AnyOf(m1, m2, m3, m4, m5), | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | ::testing::AnyOf(m6, m7, m8, m9, m10)); | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8, Matcher9 m9) { | | | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5, m6, m7, m8, | | | |
| m9)); | | | |
| } | | | |
| | | | |
| template <typename Matcher1, typename Matcher2, typename Matcher3, | | | |
| typename Matcher4, typename Matcher5, typename Matcher6, typename Match | | | |
| er7, | | | |
| typename Matcher8, typename Matcher9, typename Matcher10> | | | |
| inline internal::EitherOfMatcher<Matcher1, internal::EitherOfMatcher<Matche | | | |
| r2, | | | |
| internal::EitherOfMatcher<Matcher3, internal::EitherOfMatcher<Matcher4, | | | |
| internal::EitherOfMatcher<Matcher5, internal::EitherOfMatcher<Matcher6, | | | |
| internal::EitherOfMatcher<Matcher7, internal::EitherOfMatcher<Matcher8, | | | |
| internal::EitherOfMatcher<Matcher9, Matcher10> > > > > > > > > | | | |
| AnyOf(Matcher1 m1, Matcher2 m2, Matcher3 m3, Matcher4 m4, Matcher5 m5, | | | |
| Matcher6 m6, Matcher7 m7, Matcher8 m8, Matcher9 m9, Matcher10 m10) { | | | |
| return ::testing::AnyOf(m1, ::testing::AnyOf(m2, m3, m4, m5, m6, m7, m8, | | | |
| m9, | | | |
| m10)); | | | |
| } | | } | |
| | | | |
| } // namespace testing | | } // namespace testing | |
| | | | |
| // The MATCHER* family of macros can be used in a namespace scope to | | // The MATCHER* family of macros can be used in a namespace scope to | |
| // define custom matchers easily. | | // define custom matchers easily. | |
| // | | // | |
| // Basic Usage | | // Basic Usage | |
| // =========== | | // =========== | |
| // | | // | |
| | | | |
| skipping to change at line 1277 | | skipping to change at line 1413 | |
| }\ | | }\ | |
| virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ | | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ | |
| *gmock_os << FormatDescription(true);\ | | *gmock_os << FormatDescription(true);\ | |
| }\ | | }\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<>()));\ | | ::std::tr1::tuple<>()));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>());\ | | new gmock_Impl<arg_type>());\ | |
| }\ | | }\ | |
| name##Matcher() {\ | | name##Matcher() {\ | |
| }\ | | }\ | |
| private:\ | | private:\ | |
| GTEST_DISALLOW_ASSIGN_(name##Matcher);\ | | GTEST_DISALLOW_ASSIGN_(name##Matcher);\ | |
| };\ | | };\ | |
| inline name##Matcher name() {\ | | inline name##Matcher name() {\ | |
| return name##Matcher();\ | | return name##Matcher();\ | |
| }\ | | }\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\ | | bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P(name, p0, description)\ | | #define MATCHER_P(name, p0, description)\ | |
| template <typename p0##_type>\ | | template <typename p0##_type>\ | |
| class name##MatcherP {\ | | class name##MatcherP {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| public:\ | | public:\ | |
| | | | |
| skipping to change at line 1326 | | skipping to change at line 1462 | |
| virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ | | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ | |
| *gmock_os << FormatDescription(true);\ | | *gmock_os << FormatDescription(true);\ | |
| }\ | | }\ | |
| p0##_type p0;\ | | p0##_type p0;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type>(p0)));\ | | ::std::tr1::tuple<p0##_type>(p0)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0));\ | | new gmock_Impl<arg_type>(p0));\ | |
| }\ | | }\ | |
| | | | |
| skipping to change at line 1350 | | skipping to change at line 1486 | |
| private:\ | | private:\ | |
| GTEST_DISALLOW_ASSIGN_(name##MatcherP);\ | | GTEST_DISALLOW_ASSIGN_(name##MatcherP);\ | |
| };\ | | };\ | |
| template <typename p0##_type>\ | | template <typename p0##_type>\ | |
| inline name##MatcherP<p0##_type> name(p0##_type p0) {\ | | inline name##MatcherP<p0##_type> name(p0##_type p0) {\ | |
| return name##MatcherP<p0##_type>(p0);\ | | return name##MatcherP<p0##_type>(p0);\ | |
| }\ | | }\ | |
| template <typename p0##_type>\ | | template <typename p0##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P2(name, p0, p1, description)\ | | #define MATCHER_P2(name, p0, p1, description)\ | |
| template <typename p0##_type, typename p1##_type>\ | | template <typename p0##_type, typename p1##_type>\ | |
| class name##MatcherP2 {\ | | class name##MatcherP2 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| public:\ | | public:\ | |
| | | | |
| skipping to change at line 1379 | | skipping to change at line 1515 | |
| *gmock_os << FormatDescription(true);\ | | *gmock_os << FormatDescription(true);\ | |
| }\ | | }\ | |
| p0##_type p0;\ | | p0##_type p0;\ | |
| p1##_type p1;\ | | p1##_type p1;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\ | | ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0, p1));\ | | new gmock_Impl<arg_type>(p0, p1));\ | |
| }\ | | }\ | |
| | | | |
| skipping to change at line 1407 | | skipping to change at line 1543 | |
| };\ | | };\ | |
| template <typename p0##_type, typename p1##_type>\ | | template <typename p0##_type, typename p1##_type>\ | |
| inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \ | | inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \ | |
| p1##_type p1) {\ | | p1##_type p1) {\ | |
| return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\ | | return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type>\ | | template <typename p0##_type, typename p1##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP2<p0##_type, \ | | bool name##MatcherP2<p0##_type, \ | |
| p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P3(name, p0, p1, p2, description)\ | | #define MATCHER_P3(name, p0, p1, p2, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type>\ | | template <typename p0##_type, typename p1##_type, typename p2##_type>\ | |
| class name##MatcherP3 {\ | | class name##MatcherP3 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| public:\ | | public:\ | |
| | | | |
| skipping to change at line 1437 | | skipping to change at line 1573 | |
| }\ | | }\ | |
| p0##_type p0;\ | | p0##_type p0;\ | |
| p1##_type p1;\ | | p1##_type p1;\ | |
| p2##_type p2;\ | | p2##_type p2;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1,
\ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1,
\ | |
| p2)));\ | | p2)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0, p1, p2));\ | | new gmock_Impl<arg_type>(p0, p1, p2));\ | |
| | | | |
| skipping to change at line 1467 | | skipping to change at line 1603 | |
| };\ | | };\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type>\ | | template <typename p0##_type, typename p1##_type, typename p2##_type>\ | |
| inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0
, \ | | inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0
, \ | |
| p1##_type p1, p2##_type p2) {\ | | p1##_type p1, p2##_type p2) {\ | |
| return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\ | | return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type>\ | | template <typename p0##_type, typename p1##_type, typename p2##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP3<p0##_type, p1##_type, \ | | bool name##MatcherP3<p0##_type, p1##_type, \ | |
| p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P4(name, p0, p1, p2, p3, description)\ | | #define MATCHER_P4(name, p0, p1, p2, p3, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type>\ | | typename p3##_type>\ | |
| class name##MatcherP4 {\ | | class name##MatcherP4 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| | | | |
| skipping to change at line 1500 | | skipping to change at line 1636 | |
| p0##_type p0;\ | | p0##_type p0;\ | |
| p1##_type p1;\ | | p1##_type p1;\ | |
| p2##_type p2;\ | | p2##_type p2;\ | |
| p3##_type p3;\ | | p3##_type p3;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \ | |
| p3##_type>(p0, p1, p2, p3)));\ | | p3##_type>(p0, p1, p2, p3)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0, p1, p2, p3));\ | | new gmock_Impl<arg_type>(p0, p1, p2, p3));\ | |
| | | | |
| skipping to change at line 1536 | | skipping to change at line 1672 | |
| p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \ | | p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \ | |
| p3##_type p3) {\ | | p3##_type p3) {\ | |
| return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0,
\ | | return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0,
\ | |
| p1, p2, p3);\ | | p1, p2, p3);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type>\ | | typename p3##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \ | | bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \ | |
| p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\ | | #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type>\ | | typename p3##_type, typename p4##_type>\ | |
| class name##MatcherP5 {\ | | class name##MatcherP5 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| | | | |
| skipping to change at line 1571 | | skipping to change at line 1707 | |
| p1##_type p1;\ | | p1##_type p1;\ | |
| p2##_type p2;\ | | p2##_type p2;\ | |
| p3##_type p3;\ | | p3##_type p3;\ | |
| p4##_type p4;\ | | p4##_type p4;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type>(p0, p1, p2, p3, p4)));\ | | p4##_type>(p0, p1, p2, p3, p4)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\ | | new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\ | |
| | | | |
| skipping to change at line 1609 | | skipping to change at line 1745 | |
| p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p
3, \ | | p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p
3, \ | |
| p4##_type p4) {\ | | p4##_type p4) {\ | |
| return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \ | | return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \ | |
| p4##_type>(p0, p1, p2, p3, p4);\ | | p4##_type>(p0, p1, p2, p3, p4);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type>\ | | typename p3##_type, typename p4##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \ | | bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \ | |
| p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\ | | #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type>\ | | typename p3##_type, typename p4##_type, typename p5##_type>\ | |
| class name##MatcherP6 {\ | | class name##MatcherP6 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | | class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\ | |
| | | | |
| skipping to change at line 1645 | | skipping to change at line 1781 | |
| p2##_type p2;\ | | p2##_type p2;\ | |
| p3##_type p3;\ | | p3##_type p3;\ | |
| p4##_type p4;\ | | p4##_type p4;\ | |
| p5##_type p5;\ | | p5##_type p5;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\ | | p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\ | | new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\ | |
| | | | |
| skipping to change at line 1684 | | skipping to change at line 1820 | |
| p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2,
\ | | p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2,
\ | |
| p3##_type p3, p4##_type p4, p5##_type p5) {\ | | p3##_type p3, p4##_type p4, p5##_type p5) {\ | |
| return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \ | | return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \ | |
| p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\ | | p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type>\ | | typename p3##_type, typename p4##_type, typename p5##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | | bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | |
| p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\ | | #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type>\ | | typename p6##_type>\ | |
| class name##MatcherP7 {\ | | class name##MatcherP7 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| | | | |
| skipping to change at line 1723 | | skipping to change at line 1859 | |
| p3##_type p3;\ | | p3##_type p3;\ | |
| p4##_type p4;\ | | p4##_type p4;\ | |
| p5##_type p5;\ | | p5##_type p5;\ | |
| p6##_type p6;\ | | p6##_type p6;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5
, \ | | p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5
, \ | |
| p6)));\ | | p6)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| | | | |
| skipping to change at line 1768 | | skipping to change at line 1904 | |
| p6##_type p6) {\ | | p6##_type p6) {\ | |
| return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \ | | return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \ | |
| p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\ | | p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type>\ | | typename p6##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | | bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | |
| p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\ | | #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type>\ | | typename p6##_type, typename p7##_type>\ | |
| class name##MatcherP8 {\ | | class name##MatcherP8 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| | | | |
| skipping to change at line 1808 | | skipping to change at line 1944 | |
| p4##_type p4;\ | | p4##_type p4;\ | |
| p5##_type p5;\ | | p5##_type p5;\ | |
| p6##_type p6;\ | | p6##_type p6;\ | |
| p7##_type p7;\ | | p7##_type p7;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2,
\ | | p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2,
\ | |
| p3, p4, p5, p6, p7)));\ | | p3, p4, p5, p6, p7)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| | | | |
| skipping to change at line 1857 | | skipping to change at line 1993 | |
| p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5,
\ | | p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5,
\ | |
| p6, p7);\ | | p6, p7);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type>\ | | typename p6##_type, typename p7##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | | bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | |
| p5##_type, p6##_type, \ | | p5##_type, p6##_type, \ | |
| p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\ | | #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type, typename p8##_type>\ | | typename p6##_type, typename p7##_type, typename p8##_type>\ | |
| class name##MatcherP9 {\ | | class name##MatcherP9 {\ | |
| public:\ | | public:\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| | | | |
| skipping to change at line 1899 | | skipping to change at line 2035 | |
| p5##_type p5;\ | | p5##_type p5;\ | |
| p6##_type p6;\ | | p6##_type p6;\ | |
| p7##_type p7;\ | | p7##_type p7;\ | |
| p8##_type p8;\ | | p8##_type p8;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type, p5##_type, p6##_type, p7##_type, \ | | p4##_type, p5##_type, p6##_type, p7##_type, \ | |
| p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ | | p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| | | | |
| skipping to change at line 1950 | | skipping to change at line 2086 | |
| p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2,
\ | | p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2,
\ | |
| p3, p4, p5, p6, p7, p8);\ | | p3, p4, p5, p6, p7, p8);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type, typename p8##_type>\ | | typename p6##_type, typename p7##_type, typename p8##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | | bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_typ
e, \ | |
| p5##_type, p6##_type, p7##_type, \ | | p5##_type, p6##_type, p7##_type, \ | |
| p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, descripti
on)\ | | #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, descripti
on)\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type, typename p8##_type, \ | | typename p6##_type, typename p7##_type, typename p8##_type, \ | |
| typename p9##_type>\ | | typename p9##_type>\ | |
| class name##MatcherP10 {\ | | class name##MatcherP10 {\ | |
| public:\ | | public:\ | |
| | | | |
| skipping to change at line 1995 | | skipping to change at line 2131 | |
| p6##_type p6;\ | | p6##_type p6;\ | |
| p7##_type p7;\ | | p7##_type p7;\ | |
| p8##_type p8;\ | | p8##_type p8;\ | |
| p9##_type p9;\ | | p9##_type p9;\ | |
| private:\ | | private:\ | |
| ::testing::internal::string FormatDescription(bool negation) const {\ | | ::testing::internal::string FormatDescription(bool negation) const {\ | |
| const ::testing::internal::string gmock_description = (description)
;\ | | const ::testing::internal::string gmock_description = (description)
;\ | |
| if (!gmock_description.empty())\ | | if (!gmock_description.empty())\ | |
| return gmock_description;\ | | return gmock_description;\ | |
| return ::testing::internal::FormatMatcherDescription(\ | | return ::testing::internal::FormatMatcherDescription(\ | |
|
| negation, #name,\ | | negation, #name, \ | |
| ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | | ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ | |
| ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | | ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_typ
e, \ | |
| p4##_type, p5##_type, p6##_type, p7##_type, p8##_type,
\ | | p4##_type, p5##_type, p6##_type, p7##_type, p8##_type,
\ | |
| p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ | | p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ | |
| }\ | | }\ | |
| GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | | GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ | |
| };\ | | };\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| operator ::testing::Matcher<arg_type>() const {\ | | operator ::testing::Matcher<arg_type>() const {\ | |
| return ::testing::Matcher<arg_type>(\ | | return ::testing::Matcher<arg_type>(\ | |
| | | | |
| skipping to change at line 2049 | | skipping to change at line 2185 | |
| p1, p2, p3, p4, p5, p6, p7, p8, p9);\ | | p1, p2, p3, p4, p5, p6, p7, p8, p9);\ | |
| }\ | | }\ | |
| template <typename p0##_type, typename p1##_type, typename p2##_type, \ | | template <typename p0##_type, typename p1##_type, typename p2##_type, \ | |
| typename p3##_type, typename p4##_type, typename p5##_type, \ | | typename p3##_type, typename p4##_type, typename p5##_type, \ | |
| typename p6##_type, typename p7##_type, typename p8##_type, \ | | typename p6##_type, typename p7##_type, typename p8##_type, \ | |
| typename p9##_type>\ | | typename p9##_type>\ | |
| template <typename arg_type>\ | | template <typename arg_type>\ | |
| bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \ | | bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \ | |
| p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \ | | p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \ | |
| p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | | p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\ | |
|
| arg_type arg,\ | | arg_type arg, \ | |
| ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | | ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSE
D_)\ | |
| const | | const | |
| | | | |
| #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | | #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ | |
| | | | |
End of changes. 46 change blocks. |
| 654 lines changed or deleted | | 769 lines changed or added | |
|
| gmock-matchers.h | | gmock-matchers.h | |
| | | | |
| skipping to change at line 41 | | skipping to change at line 41 | |
| | | | |
| // Google Mock - a framework for writing C++ mock classes. | | // Google Mock - a framework for writing C++ mock classes. | |
| // | | // | |
| // This file implements some commonly used argument matchers. More | | // This file implements some commonly used argument matchers. More | |
| // matchers can be defined by the user implementing the | | // matchers can be defined by the user implementing the | |
| // MatcherInterface<T> interface if necessary. | | // MatcherInterface<T> interface if necessary. | |
| | | | |
| #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ | | #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ | |
| #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ | | #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ | |
| | | | |
|
| | | #include <math.h> | |
| #include <algorithm> | | #include <algorithm> | |
|
| | | #include <iterator> | |
| #include <limits> | | #include <limits> | |
| #include <ostream> // NOLINT | | #include <ostream> // NOLINT | |
| #include <sstream> | | #include <sstream> | |
| #include <string> | | #include <string> | |
| #include <utility> | | #include <utility> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include "gmock/internal/gmock-internal-utils.h" | | #include "gmock/internal/gmock-internal-utils.h" | |
| #include "gmock/internal/gmock-port.h" | | #include "gmock/internal/gmock-port.h" | |
| #include "gtest/gtest.h" | | #include "gtest/gtest.h" | |
| | | | |
|
| | | #if GTEST_LANG_CXX11 | |
| | | #include <initializer_list> // NOLINT -- must be after gtest.h | |
| | | #endif | |
| | | | |
| namespace testing { | | namespace testing { | |
| | | | |
| // To implement a matcher Foo for type T, define: | | // To implement a matcher Foo for type T, define: | |
| // 1. a class FooMatcherImpl that implements the | | // 1. a class FooMatcherImpl that implements the | |
| // MatcherInterface<T> interface, and | | // MatcherInterface<T> interface, and | |
| // 2. a factory function that creates a Matcher<T> object from a | | // 2. a factory function that creates a Matcher<T> object from a | |
| // FooMatcherImpl*. | | // FooMatcherImpl*. | |
| // | | // | |
| // The two-level delegation design makes it possible to allow a user | | // The two-level delegation design makes it possible to allow a user | |
| // to write "v" instead of "Eq(v)" where a Matcher is expected, which | | // to write "v" instead of "Eq(v)" where a Matcher is expected, which | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 83 | |
| // MatchResultListener is an abstract class. Its << operator can be | | // MatchResultListener is an abstract class. Its << operator can be | |
| // used by a matcher to explain why a value matches or doesn't match. | | // used by a matcher to explain why a value matches or doesn't match. | |
| // | | // | |
| // TODO(wan@google.com): add method | | // TODO(wan@google.com): add method | |
| // bool InterestedInWhy(bool result) const; | | // bool InterestedInWhy(bool result) const; | |
| // to indicate whether the listener is interested in why the match | | // to indicate whether the listener is interested in why the match | |
| // result is 'result'. | | // result is 'result'. | |
| class MatchResultListener { | | class MatchResultListener { | |
| public: | | public: | |
| // Creates a listener object with the given underlying ostream. The | | // Creates a listener object with the given underlying ostream. The | |
|
| // listener does not own the ostream. | | // listener does not own the ostream, and does not dereference it | |
| | | // in the constructor or destructor. | |
| explicit MatchResultListener(::std::ostream* os) : stream_(os) {} | | explicit MatchResultListener(::std::ostream* os) : stream_(os) {} | |
| virtual ~MatchResultListener() = 0; // Makes this class abstract. | | virtual ~MatchResultListener() = 0; // Makes this class abstract. | |
| | | | |
| // Streams x to the underlying ostream; does nothing if the ostream | | // Streams x to the underlying ostream; does nothing if the ostream | |
| // is NULL. | | // is NULL. | |
| template <typename T> | | template <typename T> | |
| MatchResultListener& operator<<(const T& x) { | | MatchResultListener& operator<<(const T& x) { | |
| if (stream_ != NULL) | | if (stream_ != NULL) | |
| *stream_ << x; | | *stream_ << x; | |
| return *this; | | return *this; | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 115 | |
| | | | |
| private: | | private: | |
| ::std::ostream* const stream_; | | ::std::ostream* const stream_; | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener); | |
| }; | | }; | |
| | | | |
| inline MatchResultListener::~MatchResultListener() { | | inline MatchResultListener::~MatchResultListener() { | |
| } | | } | |
| | | | |
|
| // The implementation of a matcher. | | // An instance of a subclass of this knows how to describe itself as a | |
| template <typename T> | | // matcher. | |
| class MatcherInterface { | | class MatcherDescriberInterface { | |
| public: | | public: | |
|
| virtual ~MatcherInterface() {} | | virtual ~MatcherDescriberInterface() {} | |
| | | | |
| // Returns true iff the matcher matches x; also explains the match | | | |
| // result to 'listener', in the form of a non-restrictive relative | | | |
| // clause ("which ...", "whose ...", etc) that describes x. For | | | |
| // example, the MatchAndExplain() method of the Pointee(...) matcher | | | |
| // should generate an explanation like "which points to ...". | | | |
| // | | | |
| // You should override this method when defining a new matcher. | | | |
| // | | | |
| // It's the responsibility of the caller (Google Mock) to guarantee | | | |
| // that 'listener' is not NULL. This helps to simplify a matcher's | | | |
| // implementation when it doesn't care about the performance, as it | | | |
| // can talk to 'listener' without checking its validity first. | | | |
| // However, in order to implement dummy listeners efficiently, | | | |
| // listener->stream() may be NULL. | | | |
| virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = | | | |
| 0; | | | |
| | | | |
| // Describes this matcher to an ostream. The function should print | | // Describes this matcher to an ostream. The function should print | |
| // a verb phrase that describes the property a value matching this | | // a verb phrase that describes the property a value matching this | |
| // matcher should have. The subject of the verb phrase is the value | | // matcher should have. The subject of the verb phrase is the value | |
| // being matched. For example, the DescribeTo() method of the Gt(7) | | // being matched. For example, the DescribeTo() method of the Gt(7) | |
| // matcher prints "is greater than 7". | | // matcher prints "is greater than 7". | |
| virtual void DescribeTo(::std::ostream* os) const = 0; | | virtual void DescribeTo(::std::ostream* os) const = 0; | |
| | | | |
| // Describes the negation of this matcher to an ostream. For | | // Describes the negation of this matcher to an ostream. For | |
| // example, if the description of this matcher is "is greater than | | // example, if the description of this matcher is "is greater than | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 141 | |
| // You are not required to override this when implementing | | // You are not required to override this when implementing | |
| // MatcherInterface, but it is highly advised so that your matcher | | // MatcherInterface, but it is highly advised so that your matcher | |
| // can produce good error messages. | | // can produce good error messages. | |
| virtual void DescribeNegationTo(::std::ostream* os) const { | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| *os << "not ("; | | *os << "not ("; | |
| DescribeTo(os); | | DescribeTo(os); | |
| *os << ")"; | | *os << ")"; | |
| } | | } | |
| }; | | }; | |
| | | | |
|
| | | // The implementation of a matcher. | |
| | | template <typename T> | |
| | | class MatcherInterface : public MatcherDescriberInterface { | |
| | | public: | |
| | | // Returns true iff the matcher matches x; also explains the match | |
| | | // result to 'listener' if necessary (see the next paragraph), in | |
| | | // the form of a non-restrictive relative clause ("which ...", | |
| | | // "whose ...", etc) that describes x. For example, the | |
| | | // MatchAndExplain() method of the Pointee(...) matcher should | |
| | | // generate an explanation like "which points to ...". | |
| | | // | |
| | | // Implementations of MatchAndExplain() should add an explanation of | |
| | | // the match result *if and only if* they can provide additional | |
| | | // information that's not already present (or not obvious) in the | |
| | | // print-out of x and the matcher's description. Whether the match | |
| | | // succeeds is not a factor in deciding whether an explanation is | |
| | | // needed, as sometimes the caller needs to print a failure message | |
| | | // when the match succeeds (e.g. when the matcher is used inside | |
| | | // Not()). | |
| | | // | |
| | | // For example, a "has at least 10 elements" matcher should explain | |
| | | // what the actual element count is, regardless of the match result, | |
| | | // as it is useful information to the reader; on the other hand, an | |
| | | // "is empty" matcher probably only needs to explain what the actual | |
| | | // size is when the match fails, as it's redundant to say that the | |
| | | // size is 0 when the value is already known to be empty. | |
| | | // | |
| | | // You should override this method when defining a new matcher. | |
| | | // | |
| | | // It's the responsibility of the caller (Google Mock) to guarantee | |
| | | // that 'listener' is not NULL. This helps to simplify a matcher's | |
| | | // implementation when it doesn't care about the performance, as it | |
| | | // can talk to 'listener' without checking its validity first. | |
| | | // However, in order to implement dummy listeners efficiently, | |
| | | // listener->stream() may be NULL. | |
| | | virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = | |
| | | 0; | |
| | | | |
| | | // Inherits these methods from MatcherDescriberInterface: | |
| | | // virtual void DescribeTo(::std::ostream* os) const = 0; | |
| | | // virtual void DescribeNegationTo(::std::ostream* os) const; | |
| | | }; | |
| | | | |
| | | // A match result listener that stores the explanation in a string. | |
| | | class StringMatchResultListener : public MatchResultListener { | |
| | | public: | |
| | | StringMatchResultListener() : MatchResultListener(&ss_) {} | |
| | | | |
| | | // Returns the explanation accumulated so far. | |
| | | internal::string str() const { return ss_.str(); } | |
| | | | |
| | | // Clears the explanation accumulated so far. | |
| | | void Clear() { ss_.str(""); } | |
| | | | |
| | | private: | |
| | | ::std::stringstream ss_; | |
| | | | |
| | | GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener); | |
| | | }; | |
| | | | |
| namespace internal { | | namespace internal { | |
| | | | |
| // A match result listener that ignores the explanation. | | // A match result listener that ignores the explanation. | |
| class DummyMatchResultListener : public MatchResultListener { | | class DummyMatchResultListener : public MatchResultListener { | |
| public: | | public: | |
| DummyMatchResultListener() : MatchResultListener(NULL) {} | | DummyMatchResultListener() : MatchResultListener(NULL) {} | |
| | | | |
| private: | | private: | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener); | |
| }; | | }; | |
| | | | |
| skipping to change at line 173 | | skipping to change at line 223 | |
| // that the former is concrete. | | // that the former is concrete. | |
| class StreamMatchResultListener : public MatchResultListener { | | class StreamMatchResultListener : public MatchResultListener { | |
| public: | | public: | |
| explicit StreamMatchResultListener(::std::ostream* os) | | explicit StreamMatchResultListener(::std::ostream* os) | |
| : MatchResultListener(os) {} | | : MatchResultListener(os) {} | |
| | | | |
| private: | | private: | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener); | |
| }; | | }; | |
| | | | |
|
| // A match result listener that stores the explanation in a string. | | | |
| class StringMatchResultListener : public MatchResultListener { | | | |
| public: | | | |
| StringMatchResultListener() : MatchResultListener(&ss_) {} | | | |
| | | | |
| // Returns the explanation heard so far. | | | |
| internal::string str() const { return ss_.str(); } | | | |
| | | | |
| private: | | | |
| ::std::stringstream ss_; | | | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener); | | | |
| }; | | | |
| | | | |
| // An internal class for implementing Matcher<T>, which will derive | | // An internal class for implementing Matcher<T>, which will derive | |
| // from it. We put functionalities common to all Matcher<T> | | // from it. We put functionalities common to all Matcher<T> | |
| // specializations here to avoid code duplication. | | // specializations here to avoid code duplication. | |
| template <typename T> | | template <typename T> | |
| class MatcherBase { | | class MatcherBase { | |
| public: | | public: | |
| // Returns true iff the matcher matches x; also explains the match | | // Returns true iff the matcher matches x; also explains the match | |
| // result to 'listener'. | | // result to 'listener'. | |
| bool MatchAndExplain(T x, MatchResultListener* listener) const { | | bool MatchAndExplain(T x, MatchResultListener* listener) const { | |
| return impl_->MatchAndExplain(x, listener); | | return impl_->MatchAndExplain(x, listener); | |
| | | | |
| skipping to change at line 219 | | skipping to change at line 255 | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| impl_->DescribeNegationTo(os); | | impl_->DescribeNegationTo(os); | |
| } | | } | |
| | | | |
| // Explains why x matches, or doesn't match, the matcher. | | // Explains why x matches, or doesn't match, the matcher. | |
| void ExplainMatchResultTo(T x, ::std::ostream* os) const { | | void ExplainMatchResultTo(T x, ::std::ostream* os) const { | |
| StreamMatchResultListener listener(os); | | StreamMatchResultListener listener(os); | |
| MatchAndExplain(x, &listener); | | MatchAndExplain(x, &listener); | |
| } | | } | |
| | | | |
|
| | | // Returns the describer for this matcher object; retains ownership | |
| | | // of the describer, which is only guaranteed to be alive when | |
| | | // this matcher object is alive. | |
| | | const MatcherDescriberInterface* GetDescriber() const { | |
| | | return impl_.get(); | |
| | | } | |
| | | | |
| protected: | | protected: | |
| MatcherBase() {} | | MatcherBase() {} | |
| | | | |
| // Constructs a matcher from its implementation. | | // Constructs a matcher from its implementation. | |
| explicit MatcherBase(const MatcherInterface<T>* impl) | | explicit MatcherBase(const MatcherInterface<T>* impl) | |
| : impl_(impl) {} | | : impl_(impl) {} | |
| | | | |
| virtual ~MatcherBase() {} | | virtual ~MatcherBase() {} | |
| | | | |
| private: | | private: | |
| | | | |
| skipping to change at line 271 | | skipping to change at line 314 | |
| | | | |
| // Implicit constructor here allows people to write | | // Implicit constructor here allows people to write | |
| // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) somet
imes | | // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) somet
imes | |
| Matcher(T value); // NOLINT | | Matcher(T value); // NOLINT | |
| }; | | }; | |
| | | | |
| // The following two specializations allow the user to write str | | // The following two specializations allow the user to write str | |
| // instead of Eq(str) and "foo" instead of Eq("foo") when a string | | // instead of Eq(str) and "foo" instead of Eq("foo") when a string | |
| // matcher is expected. | | // matcher is expected. | |
| template <> | | template <> | |
|
| class Matcher<const internal::string&> | | class GTEST_API_ Matcher<const internal::string&> | |
| : public internal::MatcherBase<const internal::string&> { | | : public internal::MatcherBase<const internal::string&> { | |
| public: | | public: | |
| Matcher() {} | | Matcher() {} | |
| | | | |
| explicit Matcher(const MatcherInterface<const internal::string&>* impl) | | explicit Matcher(const MatcherInterface<const internal::string&>* impl) | |
| : internal::MatcherBase<const internal::string&>(impl) {} | | : internal::MatcherBase<const internal::string&>(impl) {} | |
| | | | |
| // Allows the user to write str instead of Eq(str) sometimes, where | | // Allows the user to write str instead of Eq(str) sometimes, where | |
| // str is a string object. | | // str is a string object. | |
| Matcher(const internal::string& s); // NOLINT | | Matcher(const internal::string& s); // NOLINT | |
| | | | |
| // Allows the user to write "foo" instead of Eq("foo") sometimes. | | // Allows the user to write "foo" instead of Eq("foo") sometimes. | |
| Matcher(const char* s); // NOLINT | | Matcher(const char* s); // NOLINT | |
| }; | | }; | |
| | | | |
| template <> | | template <> | |
|
| class Matcher<internal::string> | | class GTEST_API_ Matcher<internal::string> | |
| : public internal::MatcherBase<internal::string> { | | : public internal::MatcherBase<internal::string> { | |
| public: | | public: | |
| Matcher() {} | | Matcher() {} | |
| | | | |
| explicit Matcher(const MatcherInterface<internal::string>* impl) | | explicit Matcher(const MatcherInterface<internal::string>* impl) | |
| : internal::MatcherBase<internal::string>(impl) {} | | : internal::MatcherBase<internal::string>(impl) {} | |
| | | | |
| // Allows the user to write str instead of Eq(str) sometimes, where | | // Allows the user to write str instead of Eq(str) sometimes, where | |
| // str is a string object. | | // str is a string object. | |
| Matcher(const internal::string& s); // NOLINT | | Matcher(const internal::string& s); // NOLINT | |
| | | | |
| // Allows the user to write "foo" instead of Eq("foo") sometimes. | | // Allows the user to write "foo" instead of Eq("foo") sometimes. | |
| Matcher(const char* s); // NOLINT | | Matcher(const char* s); // NOLINT | |
| }; | | }; | |
| | | | |
|
| | | #if GTEST_HAS_STRING_PIECE_ | |
| | | // The following two specializations allow the user to write str | |
| | | // instead of Eq(str) and "foo" instead of Eq("foo") when a StringPiece | |
| | | // matcher is expected. | |
| | | template <> | |
| | | class GTEST_API_ Matcher<const StringPiece&> | |
| | | : public internal::MatcherBase<const StringPiece&> { | |
| | | public: | |
| | | Matcher() {} | |
| | | | |
| | | explicit Matcher(const MatcherInterface<const StringPiece&>* impl) | |
| | | : internal::MatcherBase<const StringPiece&>(impl) {} | |
| | | | |
| | | // Allows the user to write str instead of Eq(str) sometimes, where | |
| | | // str is a string object. | |
| | | Matcher(const internal::string& s); // NOLINT | |
| | | | |
| | | // Allows the user to write "foo" instead of Eq("foo") sometimes. | |
| | | Matcher(const char* s); // NOLINT | |
| | | | |
| | | // Allows the user to pass StringPieces directly. | |
| | | Matcher(StringPiece s); // NOLINT | |
| | | }; | |
| | | | |
| | | template <> | |
| | | class GTEST_API_ Matcher<StringPiece> | |
| | | : public internal::MatcherBase<StringPiece> { | |
| | | public: | |
| | | Matcher() {} | |
| | | | |
| | | explicit Matcher(const MatcherInterface<StringPiece>* impl) | |
| | | : internal::MatcherBase<StringPiece>(impl) {} | |
| | | | |
| | | // Allows the user to write str instead of Eq(str) sometimes, where | |
| | | // str is a string object. | |
| | | Matcher(const internal::string& s); // NOLINT | |
| | | | |
| | | // Allows the user to write "foo" instead of Eq("foo") sometimes. | |
| | | Matcher(const char* s); // NOLINT | |
| | | | |
| | | // Allows the user to pass StringPieces directly. | |
| | | Matcher(StringPiece s); // NOLINT | |
| | | }; | |
| | | #endif // GTEST_HAS_STRING_PIECE_ | |
| | | | |
| // The PolymorphicMatcher class template makes it easy to implement a | | // The PolymorphicMatcher class template makes it easy to implement a | |
| // polymorphic matcher (i.e. a matcher that can match values of more | | // polymorphic matcher (i.e. a matcher that can match values of more | |
| // than one type, e.g. Eq(n) and NotNull()). | | // than one type, e.g. Eq(n) and NotNull()). | |
| // | | // | |
| // To define a polymorphic matcher, a user should provide an Impl | | // To define a polymorphic matcher, a user should provide an Impl | |
| // class that has a DescribeTo() method and a DescribeNegationTo() | | // class that has a DescribeTo() method and a DescribeNegationTo() | |
| // method, and define a member function (or member function template) | | // method, and define a member function (or member function template) | |
| // | | // | |
| // bool MatchAndExplain(const Value& value, | | // bool MatchAndExplain(const Value& value, | |
| // MatchResultListener* listener) const; | | // MatchResultListener* listener) const; | |
| | | | |
| skipping to change at line 373 | | skipping to change at line 461 | |
| // Creates a matcher from its implementation. This is easier to use | | // Creates a matcher from its implementation. This is easier to use | |
| // than the Matcher<T> constructor as it doesn't require you to | | // than the Matcher<T> constructor as it doesn't require you to | |
| // explicitly write the template argument, e.g. | | // explicitly write the template argument, e.g. | |
| // | | // | |
| // MakeMatcher(foo); | | // MakeMatcher(foo); | |
| // vs | | // vs | |
| // Matcher<const string&>(foo); | | // Matcher<const string&>(foo); | |
| template <typename T> | | template <typename T> | |
| inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) { | | inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) { | |
| return Matcher<T>(impl); | | return Matcher<T>(impl); | |
|
| }; | | } | |
| | | | |
| // Creates a polymorphic matcher from its implementation. This is | | // Creates a polymorphic matcher from its implementation. This is | |
| // easier to use than the PolymorphicMatcher<Impl> constructor as it | | // easier to use than the PolymorphicMatcher<Impl> constructor as it | |
| // doesn't require you to explicitly write the template argument, e.g. | | // doesn't require you to explicitly write the template argument, e.g. | |
| // | | // | |
| // MakePolymorphicMatcher(foo); | | // MakePolymorphicMatcher(foo); | |
| // vs | | // vs | |
| // PolymorphicMatcher<TypeOfFoo>(foo); | | // PolymorphicMatcher<TypeOfFoo>(foo); | |
| template <class Impl> | | template <class Impl> | |
| inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) { | | inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) { | |
| return PolymorphicMatcher<Impl>(impl); | | return PolymorphicMatcher<Impl>(impl); | |
| } | | } | |
| | | | |
|
| | | // Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION | |
| | | // and MUST NOT BE USED IN USER CODE!!! | |
| | | namespace internal { | |
| | | | |
| | | // The MatcherCastImpl class template is a helper for implementing | |
| | | // MatcherCast(). We need this helper in order to partially | |
| | | // specialize the implementation of MatcherCast() (C++ allows | |
| | | // class/struct templates to be partially specialized, but not | |
| | | // function templates.). | |
| | | | |
| | | // This general version is used when MatcherCast()'s argument is a | |
| | | // polymorphic matcher (i.e. something that can be converted to a | |
| | | // Matcher but is not one yet; for example, Eq(value)) or a value (for | |
| | | // example, "hello"). | |
| | | template <typename T, typename M> | |
| | | class MatcherCastImpl { | |
| | | public: | |
| | | static Matcher<T> Cast(M polymorphic_matcher_or_value) { | |
| | | // M can be a polymorhic matcher, in which case we want to use | |
| | | // its conversion operator to create Matcher<T>. Or it can be a value | |
| | | // that should be passed to the Matcher<T>'s constructor. | |
| | | // | |
| | | // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a | |
| | | // polymorphic matcher because it'll be ambiguous if T has an implicit | |
| | | // constructor from M (this usually happens when T has an implicit | |
| | | // constructor from any type). | |
| | | // | |
| | | // It won't work to unconditionally implict_cast | |
| | | // polymorphic_matcher_or_value to Matcher<T> because it won't trigger | |
| | | // a user-defined conversion from M to T if one exists (assuming M is | |
| | | // a value). | |
| | | return CastImpl( | |
| | | polymorphic_matcher_or_value, | |
| | | BooleanConstant< | |
| | | internal::ImplicitlyConvertible<M, Matcher<T> >::value>()); | |
| | | } | |
| | | | |
| | | private: | |
| | | static Matcher<T> CastImpl(M value, BooleanConstant<false>) { | |
| | | // M can't be implicitly converted to Matcher<T>, so M isn't a polymorp | |
| | | hic | |
| | | // matcher. It must be a value then. Use direct initialization to cre | |
| | | ate | |
| | | // a matcher. | |
| | | return Matcher<T>(ImplicitCast_<T>(value)); | |
| | | } | |
| | | | |
| | | static Matcher<T> CastImpl(M polymorphic_matcher_or_value, | |
| | | BooleanConstant<true>) { | |
| | | // M is implicitly convertible to Matcher<T>, which means that either | |
| | | // M is a polymorhpic matcher or Matcher<T> has an implicit constructor | |
| | | // from M. In both cases using the implicit conversion will produce a | |
| | | // matcher. | |
| | | // | |
| | | // Even if T has an implicit constructor from M, it won't be called bec | |
| | | ause | |
| | | // creating Matcher<T> would require a chain of two user-defined conver | |
| | | sions | |
| | | // (first to create T from M and then to create Matcher<T> from T). | |
| | | return polymorphic_matcher_or_value; | |
| | | } | |
| | | }; | |
| | | | |
| | | // This more specialized version is used when MatcherCast()'s argument | |
| | | // is already a Matcher. This only compiles when type T can be | |
| | | // statically converted to type U. | |
| | | template <typename T, typename U> | |
| | | class MatcherCastImpl<T, Matcher<U> > { | |
| | | public: | |
| | | static Matcher<T> Cast(const Matcher<U>& source_matcher) { | |
| | | return Matcher<T>(new Impl(source_matcher)); | |
| | | } | |
| | | | |
| | | private: | |
| | | class Impl : public MatcherInterface<T> { | |
| | | public: | |
| | | explicit Impl(const Matcher<U>& source_matcher) | |
| | | : source_matcher_(source_matcher) {} | |
| | | | |
| | | // We delegate the matching logic to the source matcher. | |
| | | virtual bool MatchAndExplain(T x, MatchResultListener* listener) const | |
| | | { | |
| | | return source_matcher_.MatchAndExplain(static_cast<U>(x), listener); | |
| | | } | |
| | | | |
| | | virtual void DescribeTo(::std::ostream* os) const { | |
| | | source_matcher_.DescribeTo(os); | |
| | | } | |
| | | | |
| | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| | | source_matcher_.DescribeNegationTo(os); | |
| | | } | |
| | | | |
| | | private: | |
| | | const Matcher<U> source_matcher_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(Impl); | |
| | | }; | |
| | | }; | |
| | | | |
| | | // This even more specialized version is used for efficiently casting | |
| | | // a matcher to its own type. | |
| | | template <typename T> | |
| | | class MatcherCastImpl<T, Matcher<T> > { | |
| | | public: | |
| | | static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; } | |
| | | }; | |
| | | | |
| | | } // namespace internal | |
| | | | |
| // In order to be safe and clear, casting between different matcher | | // In order to be safe and clear, casting between different matcher | |
| // types is done explicitly via MatcherCast<T>(m), which takes a | | // types is done explicitly via MatcherCast<T>(m), which takes a | |
| // matcher m and returns a Matcher<T>. It compiles only when T can be | | // matcher m and returns a Matcher<T>. It compiles only when T can be | |
| // statically converted to the argument type of m. | | // statically converted to the argument type of m. | |
| template <typename T, typename M> | | template <typename T, typename M> | |
|
| Matcher<T> MatcherCast(M m); | | inline Matcher<T> MatcherCast(M matcher) { | |
| | | return internal::MatcherCastImpl<T, M>::Cast(matcher); | |
| | | } | |
| | | | |
| // Implements SafeMatcherCast(). | | // Implements SafeMatcherCast(). | |
| // | | // | |
| // We use an intermediate class to do the actual safe casting as Nokia's | | // We use an intermediate class to do the actual safe casting as Nokia's | |
| // Symbian compiler cannot decide between | | // Symbian compiler cannot decide between | |
| // template <T, M> ... (M) and | | // template <T, M> ... (M) and | |
| // template <T, U> ... (const Matcher<U>&) | | // template <T, U> ... (const Matcher<U>&) | |
| // for function templates but can for member function templates. | | // for function templates but can for member function templates. | |
| template <typename T> | | template <typename T> | |
| class SafeMatcherCastImpl { | | class SafeMatcherCastImpl { | |
| public: | | public: | |
|
| // This overload handles polymorphic matchers only since monomorphic | | // This overload handles polymorphic matchers and values only since | |
| // matchers are handled by the next one. | | // monomorphic matchers are handled by the next one. | |
| template <typename M> | | template <typename M> | |
|
| static inline Matcher<T> Cast(M polymorphic_matcher) { | | static inline Matcher<T> Cast(M polymorphic_matcher_or_value) { | |
| return Matcher<T>(polymorphic_matcher); | | return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_val | |
| | | ue); | |
| } | | } | |
| | | | |
| // This overload handles monomorphic matchers. | | // This overload handles monomorphic matchers. | |
| // | | // | |
| // In general, if type T can be implicitly converted to type U, we can | | // In general, if type T can be implicitly converted to type U, we can | |
| // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is | | // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is | |
| // contravariant): just keep a copy of the original Matcher<U>, convert t
he | | // contravariant): just keep a copy of the original Matcher<U>, convert t
he | |
| // argument from type T to U, and then pass it to the underlying Matcher<
U>. | | // argument from type T to U, and then pass it to the underlying Matcher<
U>. | |
| // The only exception is when U is a reference and T is not, as the | | // The only exception is when U is a reference and T is not, as the | |
| // underlying Matcher<U> may be interested in the argument's address, whi
ch | | // underlying Matcher<U> may be interested in the argument's address, whi
ch | |
| | | | |
| skipping to change at line 459 | | skipping to change at line 654 | |
| // A<T>() returns a matcher that matches any value of type T. | | // A<T>() returns a matcher that matches any value of type T. | |
| template <typename T> | | template <typename T> | |
| Matcher<T> A(); | | Matcher<T> A(); | |
| | | | |
| // Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION | | // Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION | |
| // and MUST NOT BE USED IN USER CODE!!! | | // and MUST NOT BE USED IN USER CODE!!! | |
| namespace internal { | | namespace internal { | |
| | | | |
| // If the explanation is not empty, prints it to the ostream. | | // If the explanation is not empty, prints it to the ostream. | |
| inline void PrintIfNotEmpty(const internal::string& explanation, | | inline void PrintIfNotEmpty(const internal::string& explanation, | |
|
| std::ostream* os) { | | ::std::ostream* os) { | |
| if (explanation != "" && os != NULL) { | | if (explanation != "" && os != NULL) { | |
| *os << ", " << explanation; | | *os << ", " << explanation; | |
| } | | } | |
| } | | } | |
| | | | |
| // Returns true if the given type name is easy to read by a human. | | // Returns true if the given type name is easy to read by a human. | |
| // This is used to decide whether printing the type of a value might | | // This is used to decide whether printing the type of a value might | |
| // be helpful. | | // be helpful. | |
| inline bool IsReadableTypeName(const string& type_name) { | | inline bool IsReadableTypeName(const string& type_name) { | |
| // We consider a type name readable if it's short or doesn't contain | | // We consider a type name readable if it's short or doesn't contain | |
| | | | |
| skipping to change at line 603 | | skipping to change at line 798 | |
| // is no failure, nothing will be streamed to os. | | // is no failure, nothing will be streamed to os. | |
| template <typename MatcherTuple, typename ValueTuple> | | template <typename MatcherTuple, typename ValueTuple> | |
| void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, | | void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, | |
| const ValueTuple& values, | | const ValueTuple& values, | |
| ::std::ostream* os) { | | ::std::ostream* os) { | |
| using ::std::tr1::tuple_size; | | using ::std::tr1::tuple_size; | |
| TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo( | | TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo( | |
| matchers, values, os); | | matchers, values, os); | |
| } | | } | |
| | | | |
|
| // The MatcherCastImpl class template is a helper for implementing | | // TransformTupleValues and its helper. | |
| // MatcherCast(). We need this helper in order to partially | | // | |
| // specialize the implementation of MatcherCast() (C++ allows | | // TransformTupleValuesHelper hides the internal machinery that | |
| // class/struct templates to be partially specialized, but not | | // TransformTupleValues uses to implement a tuple traversal. | |
| // function templates.). | | template <typename Tuple, typename Func, typename OutIter> | |
| | | class TransformTupleValuesHelper { | |
| // This general version is used when MatcherCast()'s argument is a | | private: | |
| // polymorphic matcher (i.e. something that can be converted to a | | typedef typename ::std::tr1::tuple_size<Tuple> TupleSize; | |
| // Matcher but is not one yet; for example, Eq(value)). | | | |
| template <typename T, typename M> | | | |
| class MatcherCastImpl { | | | |
| public: | | | |
| static Matcher<T> Cast(M polymorphic_matcher) { | | | |
| return Matcher<T>(polymorphic_matcher); | | | |
| } | | | |
| }; | | | |
| | | | |
|
| // This more specialized version is used when MatcherCast()'s argument | | | |
| // is already a Matcher. This only compiles when type T can be | | | |
| // statically converted to type U. | | | |
| template <typename T, typename U> | | | |
| class MatcherCastImpl<T, Matcher<U> > { | | | |
| public: | | public: | |
|
| static Matcher<T> Cast(const Matcher<U>& source_matcher) { | | // For each member of tuple 't', taken in order, evaluates '*out++ = f(t) | |
| return Matcher<T>(new Impl(source_matcher)); | | '. | |
| | | // Returns the final value of 'out' in case the caller needs it. | |
| | | static OutIter Run(Func f, const Tuple& t, OutIter out) { | |
| | | return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out); | |
| } | | } | |
| | | | |
| private: | | private: | |
|
| class Impl : public MatcherInterface<T> { | | template <typename Tup, size_t kRemainingSize> | |
| public: | | struct IterateOverTuple { | |
| explicit Impl(const Matcher<U>& source_matcher) | | OutIter operator() (Func f, const Tup& t, OutIter out) const { | |
| : source_matcher_(source_matcher) {} | | *out++ = f(::std::tr1::get<TupleSize::value - kRemainingSize>(t)); | |
| | | return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out); | |
| // We delegate the matching logic to the source matcher. | | | |
| virtual bool MatchAndExplain(T x, MatchResultListener* listener) const | | | |
| { | | | |
| return source_matcher_.MatchAndExplain(static_cast<U>(x), listener); | | | |
| } | | } | |
|
| | | }; | |
| virtual void DescribeTo(::std::ostream* os) const { | | template <typename Tup> | |
| source_matcher_.DescribeTo(os); | | struct IterateOverTuple<Tup, 0> { | |
| } | | OutIter operator() (Func /* f */, const Tup& /* t */, OutIter out) cons | |
| | | t { | |
| virtual void DescribeNegationTo(::std::ostream* os) const { | | return out; | |
| source_matcher_.DescribeNegationTo(os); | | | |
| } | | } | |
|
| | | | |
| private: | | | |
| const Matcher<U> source_matcher_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(Impl); | | | |
| }; | | }; | |
| }; | | }; | |
| | | | |
|
| // This even more specialized version is used for efficiently casting | | // Successively invokes 'f(element)' on each element of the tuple 't', | |
| // a matcher to its own type. | | // appending each result to the 'out' iterator. Returns the final value | |
| template <typename T> | | // of 'out'. | |
| class MatcherCastImpl<T, Matcher<T> > { | | template <typename Tuple, typename Func, typename OutIter> | |
| public: | | OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) { | |
| static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; } | | return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out); | |
| }; | | } | |
| | | | |
| // Implements A<T>(). | | // Implements A<T>(). | |
| template <typename T> | | template <typename T> | |
| class AnyMatcherImpl : public MatcherInterface<T> { | | class AnyMatcherImpl : public MatcherInterface<T> { | |
| public: | | public: | |
| virtual bool MatchAndExplain( | | virtual bool MatchAndExplain( | |
| T /* x */, MatchResultListener* /* listener */) const { return true;
} | | T /* x */, MatchResultListener* /* listener */) const { return true;
} | |
| virtual void DescribeTo(::std::ostream* os) const { *os << "is anything";
} | | virtual void DescribeTo(::std::ostream* os) const { *os << "is anything";
} | |
| virtual void DescribeNegationTo(::std::ostream* os) const { | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| // This is mostly for completeness' safe, as it's not very useful | | // This is mostly for completeness' safe, as it's not very useful | |
| | | | |
| skipping to change at line 892 | | skipping to change at line 1066 | |
| // Are the tails equal? | | // Are the tails equal? | |
| return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1)); | | return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1)); | |
| } | | } | |
| | | | |
| // String matchers. | | // String matchers. | |
| | | | |
| // Implements equality-based string matchers like StrEq, StrCaseNe, and etc
. | | // Implements equality-based string matchers like StrEq, StrCaseNe, and etc
. | |
| template <typename StringType> | | template <typename StringType> | |
| class StrEqualityMatcher { | | class StrEqualityMatcher { | |
| public: | | public: | |
|
| typedef typename StringType::const_pointer ConstCharPointer; | | | |
| | | | |
| StrEqualityMatcher(const StringType& str, bool expect_eq, | | StrEqualityMatcher(const StringType& str, bool expect_eq, | |
| bool case_sensitive) | | bool case_sensitive) | |
| : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive
) {} | | : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive
) {} | |
| | | | |
|
| // When expect_eq_ is true, returns true iff s is equal to string_; | | // Accepts pointer types, particularly: | |
| // otherwise returns true iff s is not equal to string_. | | // const char* | |
| bool MatchAndExplain(ConstCharPointer s, | | // char* | |
| MatchResultListener* listener) const { | | // const wchar_t* | |
| | | // wchar_t* | |
| | | template <typename CharType> | |
| | | bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { | |
| if (s == NULL) { | | if (s == NULL) { | |
| return !expect_eq_; | | return !expect_eq_; | |
| } | | } | |
| return MatchAndExplain(StringType(s), listener); | | return MatchAndExplain(StringType(s), listener); | |
| } | | } | |
| | | | |
|
| bool MatchAndExplain(const StringType& s, | | // Matches anything that can convert to StringType. | |
| | | // | |
| | | // This is a template, not just a plain function with const StringType&, | |
| | | // because StringPiece has some interfering non-explicit constructors. | |
| | | template <typename MatcheeStringType> | |
| | | bool MatchAndExplain(const MatcheeStringType& s, | |
| MatchResultListener* /* listener */) const { | | MatchResultListener* /* listener */) const { | |
|
| const bool eq = case_sensitive_ ? s == string_ : | | const StringType& s2(s); | |
| CaseInsensitiveStringEquals(s, string_); | | const bool eq = case_sensitive_ ? s2 == string_ : | |
| | | CaseInsensitiveStringEquals(s2, string_); | |
| return expect_eq_ == eq; | | return expect_eq_ == eq; | |
| } | | } | |
| | | | |
| void DescribeTo(::std::ostream* os) const { | | void DescribeTo(::std::ostream* os) const { | |
| DescribeToHelper(expect_eq_, os); | | DescribeToHelper(expect_eq_, os); | |
| } | | } | |
| | | | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| DescribeToHelper(!expect_eq_, os); | | DescribeToHelper(!expect_eq_, os); | |
| } | | } | |
| | | | |
| skipping to change at line 946 | | skipping to change at line 1127 | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher); | | GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher); | |
| }; | | }; | |
| | | | |
| // Implements the polymorphic HasSubstr(substring) matcher, which | | // Implements the polymorphic HasSubstr(substring) matcher, which | |
| // can be used as a Matcher<T> as long as T can be converted to a | | // can be used as a Matcher<T> as long as T can be converted to a | |
| // string. | | // string. | |
| template <typename StringType> | | template <typename StringType> | |
| class HasSubstrMatcher { | | class HasSubstrMatcher { | |
| public: | | public: | |
|
| typedef typename StringType::const_pointer ConstCharPointer; | | | |
| | | | |
| explicit HasSubstrMatcher(const StringType& substring) | | explicit HasSubstrMatcher(const StringType& substring) | |
| : substring_(substring) {} | | : substring_(substring) {} | |
| | | | |
|
| // These overloaded methods allow HasSubstr(substring) to be used as a | | // Accepts pointer types, particularly: | |
| // Matcher<T> as long as T can be converted to string. Returns true | | // const char* | |
| // iff s contains substring_ as a substring. | | // char* | |
| bool MatchAndExplain(ConstCharPointer s, | | // const wchar_t* | |
| MatchResultListener* listener) const { | | // wchar_t* | |
| | | template <typename CharType> | |
| | | bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { | |
| return s != NULL && MatchAndExplain(StringType(s), listener); | | return s != NULL && MatchAndExplain(StringType(s), listener); | |
| } | | } | |
| | | | |
|
| bool MatchAndExplain(const StringType& s, | | // Matches anything that can convert to StringType. | |
| | | // | |
| | | // This is a template, not just a plain function with const StringType&, | |
| | | // because StringPiece has some interfering non-explicit constructors. | |
| | | template <typename MatcheeStringType> | |
| | | bool MatchAndExplain(const MatcheeStringType& s, | |
| MatchResultListener* /* listener */) const { | | MatchResultListener* /* listener */) const { | |
|
| return s.find(substring_) != StringType::npos; | | const StringType& s2(s); | |
| | | return s2.find(substring_) != StringType::npos; | |
| } | | } | |
| | | | |
| // Describes what this matcher matches. | | // Describes what this matcher matches. | |
| void DescribeTo(::std::ostream* os) const { | | void DescribeTo(::std::ostream* os) const { | |
| *os << "has substring "; | | *os << "has substring "; | |
| UniversalPrint(substring_, os); | | UniversalPrint(substring_, os); | |
| } | | } | |
| | | | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| *os << "has no substring "; | | *os << "has no substring "; | |
| | | | |
| skipping to change at line 987 | | skipping to change at line 1174 | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher); | | GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher); | |
| }; | | }; | |
| | | | |
| // Implements the polymorphic StartsWith(substring) matcher, which | | // Implements the polymorphic StartsWith(substring) matcher, which | |
| // can be used as a Matcher<T> as long as T can be converted to a | | // can be used as a Matcher<T> as long as T can be converted to a | |
| // string. | | // string. | |
| template <typename StringType> | | template <typename StringType> | |
| class StartsWithMatcher { | | class StartsWithMatcher { | |
| public: | | public: | |
|
| typedef typename StringType::const_pointer ConstCharPointer; | | | |
| | | | |
| explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) { | | explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) { | |
| } | | } | |
| | | | |
|
| // These overloaded methods allow StartsWith(prefix) to be used as a | | // Accepts pointer types, particularly: | |
| // Matcher<T> as long as T can be converted to string. Returns true | | // const char* | |
| // iff s starts with prefix_. | | // char* | |
| bool MatchAndExplain(ConstCharPointer s, | | // const wchar_t* | |
| MatchResultListener* listener) const { | | // wchar_t* | |
| | | template <typename CharType> | |
| | | bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { | |
| return s != NULL && MatchAndExplain(StringType(s), listener); | | return s != NULL && MatchAndExplain(StringType(s), listener); | |
| } | | } | |
| | | | |
|
| bool MatchAndExplain(const StringType& s, | | // Matches anything that can convert to StringType. | |
| | | // | |
| | | // This is a template, not just a plain function with const StringType&, | |
| | | // because StringPiece has some interfering non-explicit constructors. | |
| | | template <typename MatcheeStringType> | |
| | | bool MatchAndExplain(const MatcheeStringType& s, | |
| MatchResultListener* /* listener */) const { | | MatchResultListener* /* listener */) const { | |
|
| return s.length() >= prefix_.length() && | | const StringType& s2(s); | |
| s.substr(0, prefix_.length()) == prefix_; | | return s2.length() >= prefix_.length() && | |
| | | s2.substr(0, prefix_.length()) == prefix_; | |
| } | | } | |
| | | | |
| void DescribeTo(::std::ostream* os) const { | | void DescribeTo(::std::ostream* os) const { | |
| *os << "starts with "; | | *os << "starts with "; | |
| UniversalPrint(prefix_, os); | | UniversalPrint(prefix_, os); | |
| } | | } | |
| | | | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| *os << "doesn't start with "; | | *os << "doesn't start with "; | |
| UniversalPrint(prefix_, os); | | UniversalPrint(prefix_, os); | |
| | | | |
| skipping to change at line 1028 | | skipping to change at line 1221 | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(StartsWithMatcher); | | GTEST_DISALLOW_ASSIGN_(StartsWithMatcher); | |
| }; | | }; | |
| | | | |
| // Implements the polymorphic EndsWith(substring) matcher, which | | // Implements the polymorphic EndsWith(substring) matcher, which | |
| // can be used as a Matcher<T> as long as T can be converted to a | | // can be used as a Matcher<T> as long as T can be converted to a | |
| // string. | | // string. | |
| template <typename StringType> | | template <typename StringType> | |
| class EndsWithMatcher { | | class EndsWithMatcher { | |
| public: | | public: | |
|
| typedef typename StringType::const_pointer ConstCharPointer; | | | |
| | | | |
| explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {} | | explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {} | |
| | | | |
|
| // These overloaded methods allow EndsWith(suffix) to be used as a | | // Accepts pointer types, particularly: | |
| // Matcher<T> as long as T can be converted to string. Returns true | | // const char* | |
| // iff s ends with suffix_. | | // char* | |
| bool MatchAndExplain(ConstCharPointer s, | | // const wchar_t* | |
| MatchResultListener* listener) const { | | // wchar_t* | |
| | | template <typename CharType> | |
| | | bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { | |
| return s != NULL && MatchAndExplain(StringType(s), listener); | | return s != NULL && MatchAndExplain(StringType(s), listener); | |
| } | | } | |
| | | | |
|
| bool MatchAndExplain(const StringType& s, | | // Matches anything that can convert to StringType. | |
| | | // | |
| | | // This is a template, not just a plain function with const StringType&, | |
| | | // because StringPiece has some interfering non-explicit constructors. | |
| | | template <typename MatcheeStringType> | |
| | | bool MatchAndExplain(const MatcheeStringType& s, | |
| MatchResultListener* /* listener */) const { | | MatchResultListener* /* listener */) const { | |
|
| return s.length() >= suffix_.length() && | | const StringType& s2(s); | |
| s.substr(s.length() - suffix_.length()) == suffix_; | | return s2.length() >= suffix_.length() && | |
| | | s2.substr(s2.length() - suffix_.length()) == suffix_; | |
| } | | } | |
| | | | |
| void DescribeTo(::std::ostream* os) const { | | void DescribeTo(::std::ostream* os) const { | |
| *os << "ends with "; | | *os << "ends with "; | |
| UniversalPrint(suffix_, os); | | UniversalPrint(suffix_, os); | |
| } | | } | |
| | | | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| *os << "doesn't end with "; | | *os << "doesn't end with "; | |
| UniversalPrint(suffix_, os); | | UniversalPrint(suffix_, os); | |
| | | | |
| skipping to change at line 1070 | | skipping to change at line 1269 | |
| }; | | }; | |
| | | | |
| // Implements polymorphic matchers MatchesRegex(regex) and | | // Implements polymorphic matchers MatchesRegex(regex) and | |
| // ContainsRegex(regex), which can be used as a Matcher<T> as long as | | // ContainsRegex(regex), which can be used as a Matcher<T> as long as | |
| // T can be converted to a string. | | // T can be converted to a string. | |
| class MatchesRegexMatcher { | | class MatchesRegexMatcher { | |
| public: | | public: | |
| MatchesRegexMatcher(const RE* regex, bool full_match) | | MatchesRegexMatcher(const RE* regex, bool full_match) | |
| : regex_(regex), full_match_(full_match) {} | | : regex_(regex), full_match_(full_match) {} | |
| | | | |
|
| // These overloaded methods allow MatchesRegex(regex) to be used as | | // Accepts pointer types, particularly: | |
| // a Matcher<T> as long as T can be converted to string. Returns | | // const char* | |
| // true iff s matches regular expression regex. When full_match_ is | | // char* | |
| // true, a full match is done; otherwise a partial match is done. | | // const wchar_t* | |
| bool MatchAndExplain(const char* s, | | // wchar_t* | |
| MatchResultListener* listener) const { | | template <typename CharType> | |
| | | bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { | |
| return s != NULL && MatchAndExplain(internal::string(s), listener); | | return s != NULL && MatchAndExplain(internal::string(s), listener); | |
| } | | } | |
| | | | |
|
| bool MatchAndExplain(const internal::string& s, | | // Matches anything that can convert to internal::string. | |
| | | // | |
| | | // This is a template, not just a plain function with const internal::str | |
| | | ing&, | |
| | | // because StringPiece has some interfering non-explicit constructors. | |
| | | template <class MatcheeStringType> | |
| | | bool MatchAndExplain(const MatcheeStringType& s, | |
| MatchResultListener* /* listener */) const { | | MatchResultListener* /* listener */) const { | |
|
| return full_match_ ? RE::FullMatch(s, *regex_) : | | const internal::string& s2(s); | |
| RE::PartialMatch(s, *regex_); | | return full_match_ ? RE::FullMatch(s2, *regex_) : | |
| | | RE::PartialMatch(s2, *regex_); | |
| } | | } | |
| | | | |
| void DescribeTo(::std::ostream* os) const { | | void DescribeTo(::std::ostream* os) const { | |
| *os << (full_match_ ? "matches" : "contains") | | *os << (full_match_ ? "matches" : "contains") | |
| << " regular expression "; | | << " regular expression "; | |
| UniversalPrinter<internal::string>::Print(regex_->pattern(), os); | | UniversalPrinter<internal::string>::Print(regex_->pattern(), os); | |
| } | | } | |
| | | | |
| void DescribeNegationTo(::std::ostream* os) const { | | void DescribeNegationTo(::std::ostream* os) const { | |
| *os << "doesn't " << (full_match_ ? "match" : "contain") | | *os << "doesn't " << (full_match_ ? "match" : "contain") | |
| | | | |
| skipping to change at line 1269 | | skipping to change at line 1475 | |
| return true; | | return true; | |
| } | | } | |
| | | | |
| private: | | private: | |
| const Matcher<T> matcher1_; | | const Matcher<T> matcher1_; | |
| const Matcher<T> matcher2_; | | const Matcher<T> matcher2_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl); | | GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl); | |
| }; | | }; | |
| | | | |
|
| | | #if GTEST_LANG_CXX11 | |
| | | // MatcherList provides mechanisms for storing a variable number of matcher | |
| | | s in | |
| | | // a list structure (ListType) and creating a combining matcher from such a | |
| | | // list. | |
| | | // The template is defined recursively using the following template paramte | |
| | | rs: | |
| | | // * kSize is the length of the MatcherList. | |
| | | // * Head is the type of the first matcher of the list. | |
| | | // * Tail denotes the types of the remaining matchers of the list. | |
| | | template <int kSize, typename Head, typename... Tail> | |
| | | struct MatcherList { | |
| | | typedef MatcherList<kSize - 1, Tail...> MatcherListTail; | |
| | | typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType; | |
| | | | |
| | | // BuildList stores variadic type values in a nested pair structure. | |
| | | // Example: | |
| | | // MatcherList<3, int, string, float>::BuildList(5, "foo", 2.0) will retu | |
| | | rn | |
| | | // the corresponding result of type pair<int, pair<string, float>>. | |
| | | static ListType BuildList(const Head& matcher, const Tail&... tail) { | |
| | | return ListType(matcher, MatcherListTail::BuildList(tail...)); | |
| | | } | |
| | | | |
| | | // CreateMatcher<T> creates a Matcher<T> from a given list of matchers (b | |
| | | uilt | |
| | | // by BuildList()). CombiningMatcher<T> is used to combine the matchers o | |
| | | f the | |
| | | // list. CombiningMatcher<T> must implement MatcherInterface<T> and have | |
| | | a | |
| | | // constructor taking two Matcher<T>s as input. | |
| | | template <typename T, template <typename /* T */> class CombiningMatcher> | |
| | | static Matcher<T> CreateMatcher(const ListType& matchers) { | |
| | | return Matcher<T>(new CombiningMatcher<T>( | |
| | | SafeMatcherCast<T>(matchers.first), | |
| | | MatcherListTail::template CreateMatcher<T, CombiningMatcher>( | |
| | | matchers.second))); | |
| | | } | |
| | | }; | |
| | | | |
| | | // The following defines the base case for the recursive definition of | |
| | | // MatcherList. | |
| | | template <typename Matcher1, typename Matcher2> | |
| | | struct MatcherList<2, Matcher1, Matcher2> { | |
| | | typedef ::std::pair<Matcher1, Matcher2> ListType; | |
| | | | |
| | | static ListType BuildList(const Matcher1& matcher1, | |
| | | const Matcher2& matcher2) { | |
| | | return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2); | |
| | | } | |
| | | | |
| | | template <typename T, template <typename /* T */> class CombiningMatcher> | |
| | | static Matcher<T> CreateMatcher(const ListType& matchers) { | |
| | | return Matcher<T>(new CombiningMatcher<T>( | |
| | | SafeMatcherCast<T>(matchers.first), | |
| | | SafeMatcherCast<T>(matchers.second))); | |
| | | } | |
| | | }; | |
| | | | |
| | | // VariadicMatcher is used for the variadic implementation of | |
| | | // AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...). | |
| | | // CombiningMatcher<T> is used to recursively combine the provided matchers | |
| | | // (of type Args...). | |
| | | template <template <typename T> class CombiningMatcher, typename... Args> | |
| | | class VariadicMatcher { | |
| | | public: | |
| | | VariadicMatcher(const Args&... matchers) // NOLINT | |
| | | : matchers_(MatcherListType::BuildList(matchers...)) {} | |
| | | | |
| | | // This template type conversion operator allows an | |
| | | // VariadicMatcher<Matcher1, Matcher2...> object to match any type that | |
| | | // all of the provided matchers (Matcher1, Matcher2, ...) can match. | |
| | | template <typename T> | |
| | | operator Matcher<T>() const { | |
| | | return MatcherListType::template CreateMatcher<T, CombiningMatcher>( | |
| | | matchers_); | |
| | | } | |
| | | | |
| | | private: | |
| | | typedef MatcherList<sizeof...(Args), Args...> MatcherListType; | |
| | | | |
| | | const typename MatcherListType::ListType matchers_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(VariadicMatcher); | |
| | | }; | |
| | | | |
| | | template <typename... Args> | |
| | | using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl, Args...>; | |
| | | | |
| | | #endif // GTEST_LANG_CXX11 | |
| | | | |
| // Used for implementing the AllOf(m_1, ..., m_n) matcher, which | | // Used for implementing the AllOf(m_1, ..., m_n) matcher, which | |
| // matches a value that matches all of the matchers m_1, ..., and m_n. | | // matches a value that matches all of the matchers m_1, ..., and m_n. | |
| template <typename Matcher1, typename Matcher2> | | template <typename Matcher1, typename Matcher2> | |
| class BothOfMatcher { | | class BothOfMatcher { | |
| public: | | public: | |
| BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2) | | BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2) | |
| : matcher1_(matcher1), matcher2_(matcher2) {} | | : matcher1_(matcher1), matcher2_(matcher2) {} | |
| | | | |
| // This template type conversion operator allows a | | // This template type conversion operator allows a | |
| // BothOfMatcher<Matcher1, Matcher2> object to match any type that | | // BothOfMatcher<Matcher1, Matcher2> object to match any type that | |
| | | | |
| skipping to change at line 1356 | | skipping to change at line 1647 | |
| return false; | | return false; | |
| } | | } | |
| | | | |
| private: | | private: | |
| const Matcher<T> matcher1_; | | const Matcher<T> matcher1_; | |
| const Matcher<T> matcher2_; | | const Matcher<T> matcher2_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl); | | GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl); | |
| }; | | }; | |
| | | | |
|
| | | #if GTEST_LANG_CXX11 | |
| | | // AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, | |
| | | ...). | |
| | | template <typename... Args> | |
| | | using AnyOfMatcher = VariadicMatcher<EitherOfMatcherImpl, Args...>; | |
| | | | |
| | | #endif // GTEST_LANG_CXX11 | |
| | | | |
| // Used for implementing the AnyOf(m_1, ..., m_n) matcher, which | | // Used for implementing the AnyOf(m_1, ..., m_n) matcher, which | |
| // matches a value that matches at least one of the matchers m_1, ..., | | // matches a value that matches at least one of the matchers m_1, ..., | |
| // and m_n. | | // and m_n. | |
| template <typename Matcher1, typename Matcher2> | | template <typename Matcher1, typename Matcher2> | |
| class EitherOfMatcher { | | class EitherOfMatcher { | |
| public: | | public: | |
| EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2) | | EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2) | |
| : matcher1_(matcher1), matcher2_(matcher2) {} | | : matcher1_(matcher1), matcher2_(matcher2) {} | |
| | | | |
| // This template type conversion operator allows a | | // This template type conversion operator allows a | |
| | | | |
| skipping to change at line 1476 | | skipping to change at line 1774 | |
| // object to act as a predicate-formatter suitable for using with | | // object to act as a predicate-formatter suitable for using with | |
| // Google Test's EXPECT_PRED_FORMAT1() macro. | | // Google Test's EXPECT_PRED_FORMAT1() macro. | |
| template <typename T> | | template <typename T> | |
| AssertionResult operator()(const char* value_text, const T& x) const { | | AssertionResult operator()(const char* value_text, const T& x) const { | |
| // We convert matcher_ to a Matcher<const T&> *now* instead of | | // We convert matcher_ to a Matcher<const T&> *now* instead of | |
| // when the PredicateFormatterFromMatcher object was constructed, | | // when the PredicateFormatterFromMatcher object was constructed, | |
| // as matcher_ may be polymorphic (e.g. NotNull()) and we won't | | // as matcher_ may be polymorphic (e.g. NotNull()) and we won't | |
| // know which type to instantiate it to until we actually see the | | // know which type to instantiate it to until we actually see the | |
| // type of x here. | | // type of x here. | |
| // | | // | |
|
| // We write MatcherCast<const T&>(matcher_) instead of | | // We write SafeMatcherCast<const T&>(matcher_) instead of | |
| // Matcher<const T&>(matcher_), as the latter won't compile when | | // Matcher<const T&>(matcher_), as the latter won't compile when | |
| // matcher_ has type Matcher<T> (e.g. An<int>()). | | // matcher_ has type Matcher<T> (e.g. An<int>()). | |
|
| const Matcher<const T&> matcher = MatcherCast<const T&>(matcher_); | | // We don't write MatcherCast<const T&> either, as that allows | |
| | | // potentially unsafe downcasting of the matcher argument. | |
| | | const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_); | |
| StringMatchResultListener listener; | | StringMatchResultListener listener; | |
| if (MatchPrintAndExplain(x, matcher, &listener)) | | if (MatchPrintAndExplain(x, matcher, &listener)) | |
| return AssertionSuccess(); | | return AssertionSuccess(); | |
| | | | |
| ::std::stringstream ss; | | ::std::stringstream ss; | |
| ss << "Value of: " << value_text << "\n" | | ss << "Value of: " << value_text << "\n" | |
| << "Expected: "; | | << "Expected: "; | |
| matcher.DescribeTo(&ss); | | matcher.DescribeTo(&ss); | |
| ss << "\n Actual: " << listener.str(); | | ss << "\n Actual: " << listener.str(); | |
| return AssertionFailure() << ss.str(); | | return AssertionFailure() << ss.str(); | |
| | | | |
| skipping to change at line 1507 | | skipping to change at line 1807 | |
| | | | |
| // A helper function for converting a matcher to a predicate-formatter | | // A helper function for converting a matcher to a predicate-formatter | |
| // without the user needing to explicitly write the type. This is | | // without the user needing to explicitly write the type. This is | |
| // used for implementing ASSERT_THAT() and EXPECT_THAT(). | | // used for implementing ASSERT_THAT() and EXPECT_THAT(). | |
| template <typename M> | | template <typename M> | |
| inline PredicateFormatterFromMatcher<M> | | inline PredicateFormatterFromMatcher<M> | |
| MakePredicateFormatterFromMatcher(const M& matcher) { | | MakePredicateFormatterFromMatcher(const M& matcher) { | |
| return PredicateFormatterFromMatcher<M>(matcher); | | return PredicateFormatterFromMatcher<M>(matcher); | |
| } | | } | |
| | | | |
|
| // Implements the polymorphic floating point equality matcher, which | | // Implements the polymorphic floating point equality matcher, which matche | |
| // matches two float values using ULP-based approximation. The | | s | |
| // template is meant to be instantiated with FloatType being either | | // two float values using ULP-based approximation or, optionally, a | |
| // float or double. | | // user-specified epsilon. The template is meant to be instantiated with | |
| | | // FloatType being either float or double. | |
| template <typename FloatType> | | template <typename FloatType> | |
| class FloatingEqMatcher { | | class FloatingEqMatcher { | |
| public: | | public: | |
| // Constructor for FloatingEqMatcher. | | // Constructor for FloatingEqMatcher. | |
| // The matcher's input will be compared with rhs. The matcher treats two | | // The matcher's input will be compared with rhs. The matcher treats two | |
| // NANs as equal if nan_eq_nan is true. Otherwise, under IEEE standards, | | // NANs as equal if nan_eq_nan is true. Otherwise, under IEEE standards, | |
|
| // equality comparisons between NANs will always return false. | | // equality comparisons between NANs will always return false. We specif | |
| | | y a | |
| | | // negative max_abs_error_ term to indicate that ULP-based approximation | |
| | | will | |
| | | // be used for comparison. | |
| FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) : | | FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) : | |
|
| rhs_(rhs), nan_eq_nan_(nan_eq_nan) {} | | rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) { | |
| | | } | |
| | | | |
| | | // Constructor that supports a user-specified max_abs_error that will be | |
| | | used | |
| | | // for comparison instead of ULP-based approximation. The max absolute | |
| | | // should be non-negative. | |
| | | FloatingEqMatcher(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error | |
| | | ) : | |
| | | rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) { | |
| | | GTEST_CHECK_(max_abs_error >= 0) | |
| | | << ", where max_abs_error is" << max_abs_error; | |
| | | } | |
| | | | |
| // Implements floating point equality matcher as a Matcher<T>. | | // Implements floating point equality matcher as a Matcher<T>. | |
| template <typename T> | | template <typename T> | |
| class Impl : public MatcherInterface<T> { | | class Impl : public MatcherInterface<T> { | |
| public: | | public: | |
|
| Impl(FloatType rhs, bool nan_eq_nan) : | | Impl(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error) : | |
| rhs_(rhs), nan_eq_nan_(nan_eq_nan) {} | | rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {} | |
| | | | |
| virtual bool MatchAndExplain(T value, | | virtual bool MatchAndExplain(T value, | |
| MatchResultListener* /* listener */) const
{ | | MatchResultListener* /* listener */) const
{ | |
| const FloatingPoint<FloatType> lhs(value), rhs(rhs_); | | const FloatingPoint<FloatType> lhs(value), rhs(rhs_); | |
| | | | |
| // Compares NaNs first, if nan_eq_nan_ is true. | | // Compares NaNs first, if nan_eq_nan_ is true. | |
|
| if (nan_eq_nan_ && lhs.is_nan()) { | | if (lhs.is_nan() || rhs.is_nan()) { | |
| return rhs.is_nan(); | | if (lhs.is_nan() && rhs.is_nan()) { | |
| | | return nan_eq_nan_; | |
| | | } | |
| | | // One is nan; the other is not nan. | |
| | | return false; | |
| | | } | |
| | | if (HasMaxAbsError()) { | |
| | | // We perform an equality check so that inf will match inf, regardl | |
| | | ess | |
| | | // of error bounds. If the result of value - rhs_ would result in | |
| | | // overflow or if either value is inf, the default result is infini | |
| | | ty, | |
| | | // which should only match if max_abs_error_ is also infinity. | |
| | | return value == rhs_ || fabs(value - rhs_) <= max_abs_error_; | |
| | | } else { | |
| | | return lhs.AlmostEquals(rhs); | |
| } | | } | |
|
| | | | |
| return lhs.AlmostEquals(rhs); | | | |
| } | | } | |
| | | | |
| virtual void DescribeTo(::std::ostream* os) const { | | virtual void DescribeTo(::std::ostream* os) const { | |
| // os->precision() returns the previously set precision, which we | | // os->precision() returns the previously set precision, which we | |
| // store to restore the ostream to its original configuration | | // store to restore the ostream to its original configuration | |
| // after outputting. | | // after outputting. | |
| const ::std::streamsize old_precision = os->precision( | | const ::std::streamsize old_precision = os->precision( | |
| ::std::numeric_limits<FloatType>::digits10 + 2); | | ::std::numeric_limits<FloatType>::digits10 + 2); | |
| if (FloatingPoint<FloatType>(rhs_).is_nan()) { | | if (FloatingPoint<FloatType>(rhs_).is_nan()) { | |
| if (nan_eq_nan_) { | | if (nan_eq_nan_) { | |
| *os << "is NaN"; | | *os << "is NaN"; | |
| } else { | | } else { | |
| *os << "never matches"; | | *os << "never matches"; | |
| } | | } | |
| } else { | | } else { | |
| *os << "is approximately " << rhs_; | | *os << "is approximately " << rhs_; | |
|
| | | if (HasMaxAbsError()) { | |
| | | *os << " (absolute error <= " << max_abs_error_ << ")"; | |
| | | } | |
| } | | } | |
| os->precision(old_precision); | | os->precision(old_precision); | |
| } | | } | |
| | | | |
| virtual void DescribeNegationTo(::std::ostream* os) const { | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| // As before, get original precision. | | // As before, get original precision. | |
| const ::std::streamsize old_precision = os->precision( | | const ::std::streamsize old_precision = os->precision( | |
| ::std::numeric_limits<FloatType>::digits10 + 2); | | ::std::numeric_limits<FloatType>::digits10 + 2); | |
| if (FloatingPoint<FloatType>(rhs_).is_nan()) { | | if (FloatingPoint<FloatType>(rhs_).is_nan()) { | |
| if (nan_eq_nan_) { | | if (nan_eq_nan_) { | |
| *os << "isn't NaN"; | | *os << "isn't NaN"; | |
| } else { | | } else { | |
| *os << "is anything"; | | *os << "is anything"; | |
| } | | } | |
| } else { | | } else { | |
| *os << "isn't approximately " << rhs_; | | *os << "isn't approximately " << rhs_; | |
|
| | | if (HasMaxAbsError()) { | |
| | | *os << " (absolute error > " << max_abs_error_ << ")"; | |
| | | } | |
| } | | } | |
| // Restore original precision. | | // Restore original precision. | |
| os->precision(old_precision); | | os->precision(old_precision); | |
| } | | } | |
| | | | |
| private: | | private: | |
|
| | | bool HasMaxAbsError() const { | |
| | | return max_abs_error_ >= 0; | |
| | | } | |
| | | | |
| const FloatType rhs_; | | const FloatType rhs_; | |
| const bool nan_eq_nan_; | | const bool nan_eq_nan_; | |
|
| | | // max_abs_error will be used for value comparison when >= 0. | |
| | | const FloatType max_abs_error_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(Impl); | | GTEST_DISALLOW_ASSIGN_(Impl); | |
| }; | | }; | |
| | | | |
| // The following 3 type conversion operators allow FloatEq(rhs) and | | // The following 3 type conversion operators allow FloatEq(rhs) and | |
| // NanSensitiveFloatEq(rhs) to be used as a Matcher<float>, a | | // NanSensitiveFloatEq(rhs) to be used as a Matcher<float>, a | |
| // Matcher<const float&>, or a Matcher<float&>, but nothing else. | | // Matcher<const float&>, or a Matcher<float&>, but nothing else. | |
| // (While Google's C++ coding style doesn't allow arguments passed | | // (While Google's C++ coding style doesn't allow arguments passed | |
| // by non-const reference, we may see them in code not conforming to | | // by non-const reference, we may see them in code not conforming to | |
| // the style. Therefore Google Mock needs to support them.) | | // the style. Therefore Google Mock needs to support them.) | |
| operator Matcher<FloatType>() const { | | operator Matcher<FloatType>() const { | |
|
| return MakeMatcher(new Impl<FloatType>(rhs_, nan_eq_nan_)); | | return MakeMatcher(new Impl<FloatType>(rhs_, nan_eq_nan_, max_abs_error
_)); | |
| } | | } | |
| | | | |
| operator Matcher<const FloatType&>() const { | | operator Matcher<const FloatType&>() const { | |
|
| return MakeMatcher(new Impl<const FloatType&>(rhs_, nan_eq_nan_)); | | return MakeMatcher( | |
| | | new Impl<const FloatType&>(rhs_, nan_eq_nan_, max_abs_error_)); | |
| } | | } | |
| | | | |
| operator Matcher<FloatType&>() const { | | operator Matcher<FloatType&>() const { | |
|
| return MakeMatcher(new Impl<FloatType&>(rhs_, nan_eq_nan_)); | | return MakeMatcher(new Impl<FloatType&>(rhs_, nan_eq_nan_, max_abs_erro
r_)); | |
| } | | } | |
|
| | | | |
| private: | | private: | |
| const FloatType rhs_; | | const FloatType rhs_; | |
| const bool nan_eq_nan_; | | const bool nan_eq_nan_; | |
|
| | | // max_abs_error will be used for value comparison when >= 0. | |
| | | const FloatType max_abs_error_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher); | | GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher); | |
| }; | | }; | |
| | | | |
| // Implements the Pointee(m) matcher for matching a pointer whose | | // Implements the Pointee(m) matcher for matching a pointer whose | |
| // pointee matches matcher m. The pointer can be either raw or smart. | | // pointee matches matcher m. The pointer can be either raw or smart. | |
| template <typename InnerMatcher> | | template <typename InnerMatcher> | |
| class PointeeMatcher { | | class PointeeMatcher { | |
| public: | | public: | |
| explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher)
{} | | explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher)
{} | |
| | | | |
| skipping to change at line 1879 | | skipping to change at line 2218 | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(Impl); | | GTEST_DISALLOW_ASSIGN_(Impl); | |
| }; // class Impl | | }; // class Impl | |
| | | | |
| const CallableStorageType callable_; | | const CallableStorageType callable_; | |
| const Matcher<ResultType> matcher_; | | const Matcher<ResultType> matcher_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ResultOfMatcher); | | GTEST_DISALLOW_ASSIGN_(ResultOfMatcher); | |
| }; | | }; | |
| | | | |
|
| | | // Implements a matcher that checks the size of an STL-style container. | |
| | | template <typename SizeMatcher> | |
| | | class SizeIsMatcher { | |
| | | public: | |
| | | explicit SizeIsMatcher(const SizeMatcher& size_matcher) | |
| | | : size_matcher_(size_matcher) { | |
| | | } | |
| | | | |
| | | template <typename Container> | |
| | | operator Matcher<Container>() const { | |
| | | return MakeMatcher(new Impl<Container>(size_matcher_)); | |
| | | } | |
| | | | |
| | | template <typename Container> | |
| | | class Impl : public MatcherInterface<Container> { | |
| | | public: | |
| | | typedef internal::StlContainerView< | |
| | | GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView; | |
| | | typedef typename ContainerView::type::size_type SizeType; | |
| | | explicit Impl(const SizeMatcher& size_matcher) | |
| | | : size_matcher_(MatcherCast<SizeType>(size_matcher)) {} | |
| | | | |
| | | virtual void DescribeTo(::std::ostream* os) const { | |
| | | *os << "size "; | |
| | | size_matcher_.DescribeTo(os); | |
| | | } | |
| | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| | | *os << "size "; | |
| | | size_matcher_.DescribeNegationTo(os); | |
| | | } | |
| | | | |
| | | virtual bool MatchAndExplain(Container container, | |
| | | MatchResultListener* listener) const { | |
| | | SizeType size = container.size(); | |
| | | StringMatchResultListener size_listener; | |
| | | const bool result = size_matcher_.MatchAndExplain(size, &size_listene | |
| | | r); | |
| | | *listener | |
| | | << "whose size " << size << (result ? " matches" : " doesn't matc | |
| | | h"); | |
| | | PrintIfNotEmpty(size_listener.str(), listener->stream()); | |
| | | return result; | |
| | | } | |
| | | | |
| | | private: | |
| | | const Matcher<SizeType> size_matcher_; | |
| | | GTEST_DISALLOW_ASSIGN_(Impl); | |
| | | }; | |
| | | | |
| | | private: | |
| | | const SizeMatcher size_matcher_; | |
| | | GTEST_DISALLOW_ASSIGN_(SizeIsMatcher); | |
| | | }; | |
| | | | |
| // Implements an equality matcher for any STL-style container whose element
s | | // Implements an equality matcher for any STL-style container whose element
s | |
| // support ==. This matcher is like Eq(), but its failure explanations prov
ide | | // support ==. This matcher is like Eq(), but its failure explanations prov
ide | |
| // more detailed information that is useful when the container is used as a
set. | | // more detailed information that is useful when the container is used as a
set. | |
| // The failure message reports elements that are in one of the operands but
not | | // The failure message reports elements that are in one of the operands but
not | |
| // the other. The failure messages do not report duplicate or out-of-order | | // the other. The failure messages do not report duplicate or out-of-order | |
| // elements in the containers (which don't properly matter to sets, but can | | // elements in the containers (which don't properly matter to sets, but can | |
| // occur if the containers are vectors or lists, for example). | | // occur if the containers are vectors or lists, for example). | |
| // | | // | |
| // Uses the container's const_iterator, value_type, operator ==, | | // Uses the container's const_iterator, value_type, operator ==, | |
| // begin(), and end(). | | // begin(), and end(). | |
| | | | |
| skipping to change at line 1973 | | skipping to change at line 2364 | |
| | | | |
| return false; | | return false; | |
| } | | } | |
| | | | |
| private: | | private: | |
| const StlContainer rhs_; | | const StlContainer rhs_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher); | | GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher); | |
| }; | | }; | |
| | | | |
|
| | | // A comparator functor that uses the < operator to compare two values. | |
| | | struct LessComparator { | |
| | | template <typename T, typename U> | |
| | | bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; } | |
| | | }; | |
| | | | |
| | | // Implements WhenSortedBy(comparator, container_matcher). | |
| | | template <typename Comparator, typename ContainerMatcher> | |
| | | class WhenSortedByMatcher { | |
| | | public: | |
| | | WhenSortedByMatcher(const Comparator& comparator, | |
| | | const ContainerMatcher& matcher) | |
| | | : comparator_(comparator), matcher_(matcher) {} | |
| | | | |
| | | template <typename LhsContainer> | |
| | | operator Matcher<LhsContainer>() const { | |
| | | return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_)); | |
| | | } | |
| | | | |
| | | template <typename LhsContainer> | |
| | | class Impl : public MatcherInterface<LhsContainer> { | |
| | | public: | |
| | | typedef internal::StlContainerView< | |
| | | GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView; | |
| | | typedef typename LhsView::type LhsStlContainer; | |
| | | typedef typename LhsView::const_reference LhsStlContainerReference; | |
| | | // Transforms std::pair<const Key, Value> into std::pair<Key, Value> | |
| | | // so that we can match associative containers. | |
| | | typedef typename RemoveConstFromKey< | |
| | | typename LhsStlContainer::value_type>::type LhsValue; | |
| | | | |
| | | Impl(const Comparator& comparator, const ContainerMatcher& matcher) | |
| | | : comparator_(comparator), matcher_(matcher) {} | |
| | | | |
| | | virtual void DescribeTo(::std::ostream* os) const { | |
| | | *os << "(when sorted) "; | |
| | | matcher_.DescribeTo(os); | |
| | | } | |
| | | | |
| | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| | | *os << "(when sorted) "; | |
| | | matcher_.DescribeNegationTo(os); | |
| | | } | |
| | | | |
| | | virtual bool MatchAndExplain(LhsContainer lhs, | |
| | | MatchResultListener* listener) const { | |
| | | LhsStlContainerReference lhs_stl_container = LhsView::ConstReference( | |
| | | lhs); | |
| | | ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(), | |
| | | lhs_stl_container.end()); | |
| | | ::std::sort( | |
| | | sorted_container.begin(), sorted_container.end(), comparator_); | |
| | | | |
| | | if (!listener->IsInterested()) { | |
| | | // If the listener is not interested, we do not need to | |
| | | // construct the inner explanation. | |
| | | return matcher_.Matches(sorted_container); | |
| | | } | |
| | | | |
| | | *listener << "which is "; | |
| | | UniversalPrint(sorted_container, listener->stream()); | |
| | | *listener << " when sorted"; | |
| | | | |
| | | StringMatchResultListener inner_listener; | |
| | | const bool match = matcher_.MatchAndExplain(sorted_container, | |
| | | &inner_listener); | |
| | | PrintIfNotEmpty(inner_listener.str(), listener->stream()); | |
| | | return match; | |
| | | } | |
| | | | |
| | | private: | |
| | | const Comparator comparator_; | |
| | | const Matcher<const ::std::vector<LhsValue>&> matcher_; | |
| | | | |
| | | GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl); | |
| | | }; | |
| | | | |
| | | private: | |
| | | const Comparator comparator_; | |
| | | const ContainerMatcher matcher_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher); | |
| | | }; | |
| | | | |
| // Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher | | // Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher | |
| // must be able to be safely cast to Matcher<tuple<const T1&, const | | // must be able to be safely cast to Matcher<tuple<const T1&, const | |
| // T2&> >, where T1 and T2 are the types of elements in the LHS | | // T2&> >, where T1 and T2 are the types of elements in the LHS | |
| // container and the RHS container respectively. | | // container and the RHS container respectively. | |
| template <typename TupleMatcher, typename RhsContainer> | | template <typename TupleMatcher, typename RhsContainer> | |
| class PointwiseMatcher { | | class PointwiseMatcher { | |
| public: | | public: | |
| typedef internal::StlContainerView<RhsContainer> RhsView; | | typedef internal::StlContainerView<RhsContainer> RhsView; | |
| typedef typename RhsView::type RhsStlContainer; | | typedef typename RhsView::type RhsStlContainer; | |
| typedef typename RhsStlContainer::value_type RhsValue; | | typedef typename RhsStlContainer::value_type RhsValue; | |
| | | | |
| skipping to change at line 2011 | | skipping to change at line 2485 | |
| public: | | public: | |
| typedef internal::StlContainerView< | | typedef internal::StlContainerView< | |
| GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView; | | GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView; | |
| typedef typename LhsView::type LhsStlContainer; | | typedef typename LhsView::type LhsStlContainer; | |
| typedef typename LhsView::const_reference LhsStlContainerReference; | | typedef typename LhsView::const_reference LhsStlContainerReference; | |
| typedef typename LhsStlContainer::value_type LhsValue; | | typedef typename LhsStlContainer::value_type LhsValue; | |
| // We pass the LHS value and the RHS value to the inner matcher by | | // We pass the LHS value and the RHS value to the inner matcher by | |
| // reference, as they may be expensive to copy. We must use tuple | | // reference, as they may be expensive to copy. We must use tuple | |
| // instead of pair here, as a pair cannot hold references (C++ 98, | | // instead of pair here, as a pair cannot hold references (C++ 98, | |
| // 20.2.2 [lib.pairs]). | | // 20.2.2 [lib.pairs]). | |
|
| typedef std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatcherA
rg; | | typedef ::std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatche
rArg; | |
| | | | |
| Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs) | | Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs) | |
| // mono_tuple_matcher_ holds a monomorphic version of the tuple mat
cher. | | // mono_tuple_matcher_ holds a monomorphic version of the tuple mat
cher. | |
| : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matche
r)), | | : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matche
r)), | |
| rhs_(rhs) {} | | rhs_(rhs) {} | |
| | | | |
| virtual void DescribeTo(::std::ostream* os) const { | | virtual void DescribeTo(::std::ostream* os) const { | |
| *os << "contains " << rhs_.size() | | *os << "contains " << rhs_.size() | |
| << " values, where each value and its corresponding value in "; | | << " values, where each value and its corresponding value in "; | |
| UniversalPrinter<RhsStlContainer>::Print(rhs_, os); | | UniversalPrinter<RhsStlContainer>::Print(rhs_, os); | |
| | | | |
| skipping to change at line 2404 | | skipping to change at line 2878 | |
| public: | | public: | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | |
| typedef internal::StlContainerView<RawContainer> View; | | typedef internal::StlContainerView<RawContainer> View; | |
| typedef typename View::type StlContainer; | | typedef typename View::type StlContainer; | |
| typedef typename View::const_reference StlContainerReference; | | typedef typename View::const_reference StlContainerReference; | |
| typedef typename StlContainer::value_type Element; | | typedef typename StlContainer::value_type Element; | |
| | | | |
| // Constructs the matcher from a sequence of element values or | | // Constructs the matcher from a sequence of element values or | |
| // element matchers. | | // element matchers. | |
| template <typename InputIter> | | template <typename InputIter> | |
|
| ElementsAreMatcherImpl(InputIter first, size_t a_count) { | | ElementsAreMatcherImpl(InputIter first, InputIter last) { | |
| matchers_.reserve(a_count); | | while (first != last) { | |
| InputIter it = first; | | matchers_.push_back(MatcherCast<const Element&>(*first++)); | |
| for (size_t i = 0; i != a_count; ++i, ++it) { | | | |
| matchers_.push_back(MatcherCast<const Element&>(*it)); | | | |
| } | | } | |
| } | | } | |
| | | | |
| // Describes what this matcher does. | | // Describes what this matcher does. | |
| virtual void DescribeTo(::std::ostream* os) const { | | virtual void DescribeTo(::std::ostream* os) const { | |
| if (count() == 0) { | | if (count() == 0) { | |
| *os << "is empty"; | | *os << "is empty"; | |
| } else if (count() == 1) { | | } else if (count() == 1) { | |
| *os << "has 1 element that "; | | *os << "has 1 element that "; | |
| matchers_[0].DescribeTo(os); | | matchers_[0].DescribeTo(os); | |
| | | | |
| skipping to change at line 2450 | | skipping to change at line 2922 | |
| *os << "element #" << i << " "; | | *os << "element #" << i << " "; | |
| matchers_[i].DescribeNegationTo(os); | | matchers_[i].DescribeNegationTo(os); | |
| if (i + 1 < count()) { | | if (i + 1 < count()) { | |
| *os << ", or\n"; | | *os << ", or\n"; | |
| } | | } | |
| } | | } | |
| } | | } | |
| | | | |
| virtual bool MatchAndExplain(Container container, | | virtual bool MatchAndExplain(Container container, | |
| MatchResultListener* listener) const { | | MatchResultListener* listener) const { | |
|
| | | // To work with stream-like "containers", we must only walk | |
| | | // through the elements in one pass. | |
| | | | |
| | | const bool listener_interested = listener->IsInterested(); | |
| | | | |
| | | // explanations[i] is the explanation of the element at index i. | |
| | | ::std::vector<internal::string> explanations(count()); | |
| StlContainerReference stl_container = View::ConstReference(container); | | StlContainerReference stl_container = View::ConstReference(container); | |
|
| const size_t actual_count = stl_container.size(); | | typename StlContainer::const_iterator it = stl_container.begin(); | |
| | | size_t exam_pos = 0; | |
| | | bool mismatch_found = false; // Have we found a mismatched element yet | |
| | | ? | |
| | | | |
| | | // Go through the elements and matchers in pairs, until we reach | |
| | | // the end of either the elements or the matchers, or until we find a | |
| | | // mismatch. | |
| | | for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_p | |
| | | os) { | |
| | | bool match; // Does the current element match the current matcher? | |
| | | if (listener_interested) { | |
| | | StringMatchResultListener s; | |
| | | match = matchers_[exam_pos].MatchAndExplain(*it, &s); | |
| | | explanations[exam_pos] = s.str(); | |
| | | } else { | |
| | | match = matchers_[exam_pos].Matches(*it); | |
| | | } | |
| | | | |
| | | if (!match) { | |
| | | mismatch_found = true; | |
| | | break; | |
| | | } | |
| | | } | |
| | | // If mismatch_found is true, 'exam_pos' is the index of the mismatch. | |
| | | | |
| | | // Find how many elements the actual container has. We avoid | |
| | | // calling size() s.t. this code works for stream-like "containers" | |
| | | // that don't define size(). | |
| | | size_t actual_count = exam_pos; | |
| | | for (; it != stl_container.end(); ++it) { | |
| | | ++actual_count; | |
| | | } | |
| | | | |
| if (actual_count != count()) { | | if (actual_count != count()) { | |
| // The element count doesn't match. If the container is empty, | | // The element count doesn't match. If the container is empty, | |
| // there's no need to explain anything as Google Mock already | | // there's no need to explain anything as Google Mock already | |
| // prints the empty container. Otherwise we just need to show | | // prints the empty container. Otherwise we just need to show | |
| // how many elements there actually are. | | // how many elements there actually are. | |
|
| if (actual_count != 0) { | | if (listener_interested && (actual_count != 0)) { | |
| *listener << "which has " << Elements(actual_count); | | *listener << "which has " << Elements(actual_count); | |
| } | | } | |
| return false; | | return false; | |
| } | | } | |
| | | | |
|
| typename StlContainer::const_iterator it = stl_container.begin(); | | if (mismatch_found) { | |
| // explanations[i] is the explanation of the element at index i. | | // The element count matches, but the exam_pos-th element doesn't mat | |
| std::vector<internal::string> explanations(count()); | | ch. | |
| for (size_t i = 0; i != count(); ++it, ++i) { | | if (listener_interested) { | |
| StringMatchResultListener s; | | *listener << "whose element #" << exam_pos << " doesn't match"; | |
| if (matchers_[i].MatchAndExplain(*it, &s)) { | | PrintIfNotEmpty(explanations[exam_pos], listener->stream()); | |
| explanations[i] = s.str(); | | | |
| } else { | | | |
| // The container has the right size but the i-th element | | | |
| // doesn't match its expectation. | | | |
| *listener << "whose element #" << i << " doesn't match"; | | | |
| PrintIfNotEmpty(s.str(), listener->stream()); | | | |
| return false; | | | |
| } | | } | |
|
| | | return false; | |
| } | | } | |
| | | | |
| // Every element matches its expectation. We need to explain why | | // Every element matches its expectation. We need to explain why | |
| // (the obvious ones can be skipped). | | // (the obvious ones can be skipped). | |
|
| bool reason_printed = false; | | if (listener_interested) { | |
| for (size_t i = 0; i != count(); ++i) { | | bool reason_printed = false; | |
| const internal::string& s = explanations[i]; | | for (size_t i = 0; i != count(); ++i) { | |
| if (!s.empty()) { | | const internal::string& s = explanations[i]; | |
| if (reason_printed) { | | if (!s.empty()) { | |
| *listener << ",\nand "; | | if (reason_printed) { | |
| | | *listener << ",\nand "; | |
| | | } | |
| | | *listener << "whose element #" << i << " matches, " << s; | |
| | | reason_printed = true; | |
| } | | } | |
|
| *listener << "whose element #" << i << " matches, " << s; | | | |
| reason_printed = true; | | | |
| } | | } | |
| } | | } | |
|
| | | | |
| return true; | | return true; | |
| } | | } | |
| | | | |
| private: | | private: | |
| static Message Elements(size_t count) { | | static Message Elements(size_t count) { | |
| return Message() << count << (count == 1 ? " element" : " elements"); | | return Message() << count << (count == 1 ? " element" : " elements"); | |
| } | | } | |
| | | | |
| size_t count() const { return matchers_.size(); } | | size_t count() const { return matchers_.size(); } | |
|
| std::vector<Matcher<const Element&> > matchers_; | | | |
| | | ::std::vector<Matcher<const Element&> > matchers_; | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl); | | GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl); | |
| }; | | }; | |
| | | | |
|
| // Implements ElementsAre() of 0 arguments. | | // Connectivity matrix of (elements X matchers), in element-major order. | |
| class ElementsAreMatcher0 { | | // Initially, there are no edges. | |
| | | // Use NextGraph() to iterate over all possible edge configurations. | |
| | | // Use Randomize() to generate a random edge configuration. | |
| | | class GTEST_API_ MatchMatrix { | |
| | | public: | |
| | | MatchMatrix(size_t num_elements, size_t num_matchers) | |
| | | : num_elements_(num_elements), | |
| | | num_matchers_(num_matchers), | |
| | | matched_(num_elements_* num_matchers_, 0) { | |
| | | } | |
| | | | |
| | | size_t LhsSize() const { return num_elements_; } | |
| | | size_t RhsSize() const { return num_matchers_; } | |
| | | bool HasEdge(size_t ilhs, size_t irhs) const { | |
| | | return matched_[SpaceIndex(ilhs, irhs)] == 1; | |
| | | } | |
| | | void SetEdge(size_t ilhs, size_t irhs, bool b) { | |
| | | matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0; | |
| | | } | |
| | | | |
| | | // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number | |
| | | , | |
| | | // adds 1 to that number; returns false if incrementing the graph left it | |
| | | // empty. | |
| | | bool NextGraph(); | |
| | | | |
| | | void Randomize(); | |
| | | | |
| | | string DebugString() const; | |
| | | | |
| | | private: | |
| | | size_t SpaceIndex(size_t ilhs, size_t irhs) const { | |
| | | return ilhs * num_matchers_ + irhs; | |
| | | } | |
| | | | |
| | | size_t num_elements_; | |
| | | size_t num_matchers_; | |
| | | | |
| | | // Each element is a char interpreted as bool. They are stored as a | |
| | | // flattened array in lhs-major order, use 'SpaceIndex()' to translate | |
| | | // a (ilhs, irhs) matrix coordinate into an offset. | |
| | | ::std::vector<char> matched_; | |
| | | }; | |
| | | | |
| | | typedef ::std::pair<size_t, size_t> ElementMatcherPair; | |
| | | typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs; | |
| | | | |
| | | // Returns a maximum bipartite matching for the specified graph 'g'. | |
| | | // The matching is represented as a vector of {element, matcher} pairs. | |
| | | GTEST_API_ ElementMatcherPairs | |
| | | FindMaxBipartiteMatching(const MatchMatrix& g); | |
| | | | |
| | | GTEST_API_ bool FindPairing(const MatchMatrix& matrix, | |
| | | MatchResultListener* listener); | |
| | | | |
| | | // Untyped base class for implementing UnorderedElementsAre. By | |
| | | // putting logic that's not specific to the element type here, we | |
| | | // reduce binary bloat and increase compilation speed. | |
| | | class GTEST_API_ UnorderedElementsAreMatcherImplBase { | |
| | | protected: | |
| | | // A vector of matcher describers, one for each element matcher. | |
| | | // Does not own the describers (and thus can be used only when the | |
| | | // element matchers are alive). | |
| | | typedef ::std::vector<const MatcherDescriberInterface*> MatcherDescriberV | |
| | | ec; | |
| | | | |
| | | // Describes this UnorderedElementsAre matcher. | |
| | | void DescribeToImpl(::std::ostream* os) const; | |
| | | | |
| | | // Describes the negation of this UnorderedElementsAre matcher. | |
| | | void DescribeNegationToImpl(::std::ostream* os) const; | |
| | | | |
| | | bool VerifyAllElementsAndMatchersAreMatched( | |
| | | const ::std::vector<string>& element_printouts, | |
| | | const MatchMatrix& matrix, | |
| | | MatchResultListener* listener) const; | |
| | | | |
| | | MatcherDescriberVec& matcher_describers() { | |
| | | return matcher_describers_; | |
| | | } | |
| | | | |
| | | static Message Elements(size_t n) { | |
| | | return Message() << n << " element" << (n == 1 ? "" : "s"); | |
| | | } | |
| | | | |
| | | private: | |
| | | MatcherDescriberVec matcher_describers_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase); | |
| | | }; | |
| | | | |
| | | // Implements unordered ElementsAre and unordered ElementsAreArray. | |
| | | template <typename Container> | |
| | | class UnorderedElementsAreMatcherImpl | |
| | | : public MatcherInterface<Container>, | |
| | | public UnorderedElementsAreMatcherImplBase { | |
| | | public: | |
| | | typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | |
| | | typedef internal::StlContainerView<RawContainer> View; | |
| | | typedef typename View::type StlContainer; | |
| | | typedef typename View::const_reference StlContainerReference; | |
| | | typedef typename StlContainer::const_iterator StlContainerConstIterator; | |
| | | typedef typename StlContainer::value_type Element; | |
| | | | |
| | | // Constructs the matcher from a sequence of element values or | |
| | | // element matchers. | |
| | | template <typename InputIter> | |
| | | UnorderedElementsAreMatcherImpl(InputIter first, InputIter last) { | |
| | | for (; first != last; ++first) { | |
| | | matchers_.push_back(MatcherCast<const Element&>(*first)); | |
| | | matcher_describers().push_back(matchers_.back().GetDescriber()); | |
| | | } | |
| | | } | |
| | | | |
| | | // Describes what this matcher does. | |
| | | virtual void DescribeTo(::std::ostream* os) const { | |
| | | return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os); | |
| | | } | |
| | | | |
| | | // Describes what the negation of this matcher does. | |
| | | virtual void DescribeNegationTo(::std::ostream* os) const { | |
| | | return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os); | |
| | | } | |
| | | | |
| | | virtual bool MatchAndExplain(Container container, | |
| | | MatchResultListener* listener) const { | |
| | | StlContainerReference stl_container = View::ConstReference(container); | |
| | | ::std::vector<string> element_printouts; | |
| | | MatchMatrix matrix = AnalyzeElements(stl_container.begin(), | |
| | | stl_container.end(), | |
| | | &element_printouts, | |
| | | listener); | |
| | | | |
| | | const size_t actual_count = matrix.LhsSize(); | |
| | | if (actual_count == 0 && matchers_.empty()) { | |
| | | return true; | |
| | | } | |
| | | if (actual_count != matchers_.size()) { | |
| | | // The element count doesn't match. If the container is empty, | |
| | | // there's no need to explain anything as Google Mock already | |
| | | // prints the empty container. Otherwise we just need to show | |
| | | // how many elements there actually are. | |
| | | if (actual_count != 0 && listener->IsInterested()) { | |
| | | *listener << "which has " << Elements(actual_count); | |
| | | } | |
| | | return false; | |
| | | } | |
| | | | |
| | | return VerifyAllElementsAndMatchersAreMatched(element_printouts, | |
| | | matrix, listener) && | |
| | | FindPairing(matrix, listener); | |
| | | } | |
| | | | |
| | | private: | |
| | | typedef ::std::vector<Matcher<const Element&> > MatcherVec; | |
| | | | |
| | | template <typename ElementIter> | |
| | | MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last | |
| | | , | |
| | | ::std::vector<string>* element_printouts, | |
| | | MatchResultListener* listener) const { | |
| | | element_printouts->clear(); | |
| | | ::std::vector<char> did_match; | |
| | | size_t num_elements = 0; | |
| | | for (; elem_first != elem_last; ++num_elements, ++elem_first) { | |
| | | if (listener->IsInterested()) { | |
| | | element_printouts->push_back(PrintToString(*elem_first)); | |
| | | } | |
| | | for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) { | |
| | | did_match.push_back(Matches(matchers_[irhs])(*elem_first)); | |
| | | } | |
| | | } | |
| | | | |
| | | MatchMatrix matrix(num_elements, matchers_.size()); | |
| | | ::std::vector<char>::const_iterator did_match_iter = did_match.begin(); | |
| | | for (size_t ilhs = 0; ilhs != num_elements; ++ilhs) { | |
| | | for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) { | |
| | | matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0); | |
| | | } | |
| | | } | |
| | | return matrix; | |
| | | } | |
| | | | |
| | | MatcherVec matchers_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl); | |
| | | }; | |
| | | | |
| | | // Functor for use in TransformTuple. | |
| | | // Performs MatcherCast<Target> on an input argument of any type. | |
| | | template <typename Target> | |
| | | struct CastAndAppendTransform { | |
| | | template <typename Arg> | |
| | | Matcher<Target> operator()(const Arg& a) const { | |
| | | return MatcherCast<Target>(a); | |
| | | } | |
| | | }; | |
| | | | |
| | | // Implements UnorderedElementsAre. | |
| | | template <typename MatcherTuple> | |
| | | class UnorderedElementsAreMatcher { | |
| | | public: | |
| | | explicit UnorderedElementsAreMatcher(const MatcherTuple& args) | |
| | | : matchers_(args) {} | |
| | | | |
| | | template <typename Container> | |
| | | operator Matcher<Container>() const { | |
| | | typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | |
| | | typedef typename internal::StlContainerView<RawContainer>::type View; | |
| | | typedef typename View::value_type Element; | |
| | | typedef ::std::vector<Matcher<const Element&> > MatcherVec; | |
| | | MatcherVec matchers; | |
| | | matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value); | |
| | | TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers | |
| | | _, | |
| | | ::std::back_inserter(matchers)); | |
| | | return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>( | |
| | | matchers.begin(), matchers.end())); | |
| | | } | |
| | | | |
| | | private: | |
| | | const MatcherTuple matchers_; | |
| | | GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher); | |
| | | }; | |
| | | | |
| | | // Implements ElementsAre. | |
| | | template <typename MatcherTuple> | |
| | | class ElementsAreMatcher { | |
| public: | | public: | |
|
| ElementsAreMatcher0() {} | | explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {
} | |
| | | | |
| template <typename Container> | | template <typename Container> | |
| operator Matcher<Container>() const { | | operator Matcher<Container>() const { | |
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | |
|
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | typedef typename internal::StlContainerView<RawContainer>::type View; | |
| type | | typedef typename View::value_type Element; | |
| Element; | | typedef ::std::vector<Matcher<const Element&> > MatcherVec; | |
| | | MatcherVec matchers; | |
| | | matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value); | |
| | | TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers | |
| | | _, | |
| | | ::std::back_inserter(matchers)); | |
| | | return MakeMatcher(new ElementsAreMatcherImpl<Container>( | |
| | | matchers.begin(), matchers.end())); | |
| | | } | |
| | | | |
| | | private: | |
| | | const MatcherTuple matchers_; | |
| | | GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher); | |
| | | }; | |
| | | | |
| | | // Implements UnorderedElementsAreArray(). | |
| | | template <typename T> | |
| | | class UnorderedElementsAreArrayMatcher { | |
| | | public: | |
| | | UnorderedElementsAreArrayMatcher() {} | |
| | | | |
| | | template <typename Iter> | |
| | | UnorderedElementsAreArrayMatcher(Iter first, Iter last) | |
| | | : matchers_(first, last) {} | |
| | | | |
|
| const Matcher<const Element&>* const matchers = NULL; | | template <typename Container> | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 0)); | | operator Matcher<Container>() const { | |
| | | return MakeMatcher( | |
| | | new UnorderedElementsAreMatcherImpl<Container>(matchers_.begin(), | |
| | | matchers_.end())); | |
| } | | } | |
|
| | | | |
| | | private: | |
| | | ::std::vector<T> matchers_; | |
| | | | |
| | | GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher); | |
| }; | | }; | |
| | | | |
| // Implements ElementsAreArray(). | | // Implements ElementsAreArray(). | |
| template <typename T> | | template <typename T> | |
| class ElementsAreArrayMatcher { | | class ElementsAreArrayMatcher { | |
| public: | | public: | |
|
| ElementsAreArrayMatcher(const T* first, size_t count) : | | template <typename Iter> | |
| first_(first), count_(count) {} | | ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) { | |
| | | } | |
| | | | |
| template <typename Container> | | template <typename Container> | |
| operator Matcher<Container>() const { | | operator Matcher<Container>() const { | |
|
| typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; | | return MakeMatcher(new ElementsAreMatcherImpl<Container>( | |
| typedef typename internal::StlContainerView<RawContainer>::type::value_ | | matchers_.begin(), matchers_.end())); | |
| type | | | |
| Element; | | | |
| | | | |
| return MakeMatcher(new ElementsAreMatcherImpl<Container>(first_, count_ | | | |
| )); | | | |
| } | | } | |
| | | | |
| private: | | private: | |
|
| const T* const first_; | | const ::std::vector<T> matchers_; | |
| const size_t count_; | | | |
| | | | |
| GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher); | | GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher); | |
| }; | | }; | |
| | | | |
| // Returns the description for a matcher defined using the MATCHER*() | | // Returns the description for a matcher defined using the MATCHER*() | |
| // macro where the user-supplied description string is "", if | | // macro where the user-supplied description string is "", if | |
| // 'negation' is false; otherwise returns the description of the | | // 'negation' is false; otherwise returns the description of the | |
| // negation of the matcher. 'param_values' contains a list of strings | | // negation of the matcher. 'param_values' contains a list of strings | |
| // that are the print-out of the matcher's parameters. | | // that are the print-out of the matcher's parameters. | |
|
| string FormatMatcherDescription(bool negation, const char* matcher_name, | | GTEST_API_ string FormatMatcherDescription(bool negation, | |
| const Strings& param_values); | | const char* matcher_name, | |
| | | const Strings& param_values); | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
|
| // Implements MatcherCast(). | | // ElementsAreArray(first, last) | |
| template <typename T, typename M> | | // ElementsAreArray(pointer, count) | |
| inline Matcher<T> MatcherCast(M matcher) { | | // ElementsAreArray(array) | |
| return internal::MatcherCastImpl<T, M>::Cast(matcher); | | // ElementsAreArray(vector) | |
| | | // ElementsAreArray({ e1, e2, ..., en }) | |
| | | // | |
| | | // The ElementsAreArray() functions are like ElementsAre(...), except | |
| | | // that they are given a homogeneous sequence rather than taking each | |
| | | // element as a function argument. The sequence can be specified as an | |
| | | // array, a pointer and count, a vector, an initializer list, or an | |
| | | // STL iterator range. In each of these cases, the underlying sequence | |
| | | // can be either a sequence of values or a sequence of matchers. | |
| | | // | |
| | | // All forms of ElementsAreArray() make a copy of the input matcher sequenc | |
| | | e. | |
| | | | |
| | | template <typename Iter> | |
| | | inline internal::ElementsAreArrayMatcher< | |
| | | typename ::std::iterator_traits<Iter>::value_type> | |
| | | ElementsAreArray(Iter first, Iter last) { | |
| | | typedef typename ::std::iterator_traits<Iter>::value_type T; | |
| | | return internal::ElementsAreArrayMatcher<T>(first, last); | |
| | | } | |
| | | | |
| | | template <typename T> | |
| | | inline internal::ElementsAreArrayMatcher<T> ElementsAreArray( | |
| | | const T* pointer, size_t count) { | |
| | | return ElementsAreArray(pointer, pointer + count); | |
| | | } | |
| | | | |
| | | template <typename T, size_t N> | |
| | | inline internal::ElementsAreArrayMatcher<T> ElementsAreArray( | |
| | | const T (&array)[N]) { | |
| | | return ElementsAreArray(array, N); | |
| | | } | |
| | | | |
| | | template <typename T, typename A> | |
| | | inline internal::ElementsAreArrayMatcher<T> ElementsAreArray( | |
| | | const ::std::vector<T, A>& vec) { | |
| | | return ElementsAreArray(vec.begin(), vec.end()); | |
| | | } | |
| | | | |
| | | #if GTEST_LANG_CXX11 | |
| | | template <typename T> | |
| | | inline internal::ElementsAreArrayMatcher<T> | |
| | | ElementsAreArray(::std::initializer_list<T> xs) { | |
| | | return ElementsAreArray(xs.begin(), xs.end()); | |
| | | } | |
| | | #endif | |
| | | | |
| | | // UnorderedElementsAreArray(first, last) | |
| | | // UnorderedElementsAreArray(pointer, count) | |
| | | // UnorderedElementsAreArray(array) | |
| | | // UnorderedElementsAreArray(vector) | |
| | | // UnorderedElementsAreArray({ e1, e2, ..., en }) | |
| | | // | |
| | | // The UnorderedElementsAreArray() functions are like | |
| | | // ElementsAreArray(...), but allow matching the elements in any order. | |
| | | template <typename Iter> | |
| | | inline internal::UnorderedElementsAreArrayMatcher< | |
| | | typename ::std::iterator_traits<Iter>::value_type> | |
| | | UnorderedElementsAreArray(Iter first, Iter last) { | |
| | | typedef typename ::std::iterator_traits<Iter>::value_type T; | |
| | | return internal::UnorderedElementsAreArrayMatcher<T>(first, last); | |
| | | } | |
| | | | |
| | | template <typename T> | |
| | | inline internal::UnorderedElementsAreArrayMatcher<T> | |
| | | UnorderedElementsAreArray(const T* pointer, size_t count) { | |
| | | return UnorderedElementsAreArray(pointer, pointer + count); | |
| | | } | |
| | | | |
| | | template <typename T, size_t N> | |
| | | inline internal::UnorderedElementsAreArrayMatcher<T> | |
| | | UnorderedElementsAreArray(const T (&array)[N]) { | |
| | | return UnorderedElementsAreArray(array, N); | |
| | | } | |
| | | | |
| | | template <typename T, typename A> | |
| | | inline internal::UnorderedElementsAreArrayMatcher<T> | |
| | | UnorderedElementsAreArray(const ::std::vector<T, A>& vec) { | |
| | | return UnorderedElementsAreArray(vec.begin(), vec.end()); | |
| | | } | |
| | | | |
| | | #if GTEST_LANG_CXX11 | |
| | | template <typename T> | |
| | | inline internal::UnorderedElementsAreArrayMatcher<T> | |
| | | UnorderedElementsAreArray(::std::initializer_list<T> xs) { | |
| | | return UnorderedElementsAreArray(xs.begin(), xs.end()); | |
| } | | } | |
|
| | | #endif | |
| | | | |
| // _ is a matcher that matches anything of any type. | | // _ is a matcher that matches anything of any type. | |
| // | | // | |
| // This definition is fine as: | | // This definition is fine as: | |
| // | | // | |
| // 1. The C++ standard permits using the name _ in a namespace that | | // 1. The C++ standard permits using the name _ in a namespace that | |
| // is not the global namespace or ::std. | | // is not the global namespace or ::std. | |
| // 2. The AnythingMatcher class has no data member or constructor, | | // 2. The AnythingMatcher class has no data member or constructor, | |
| // so it's OK to create global variables of this type. | | // so it's OK to create global variables of this type. | |
| // 3. c-style has approved of using _ in this case. | | // 3. c-style has approved of using _ in this case. | |
| | | | |
| skipping to change at line 2667 | | skipping to change at line 3508 | |
| inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) { | | inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) { | |
| return internal::FloatingEqMatcher<double>(rhs, false); | | return internal::FloatingEqMatcher<double>(rhs, false); | |
| } | | } | |
| | | | |
| // Creates a matcher that matches any double argument approximately | | // Creates a matcher that matches any double argument approximately | |
| // equal to rhs, including NaN values when rhs is NaN. | | // equal to rhs, including NaN values when rhs is NaN. | |
| inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs)
{ | | inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs)
{ | |
| return internal::FloatingEqMatcher<double>(rhs, true); | | return internal::FloatingEqMatcher<double>(rhs, true); | |
| } | | } | |
| | | | |
|
| | | // Creates a matcher that matches any double argument approximately equal t | |
| | | o | |
| | | // rhs, up to the specified max absolute error bound, where two NANs are | |
| | | // considered unequal. The max absolute error bound must be non-negative. | |
| | | inline internal::FloatingEqMatcher<double> DoubleNear( | |
| | | double rhs, double max_abs_error) { | |
| | | return internal::FloatingEqMatcher<double>(rhs, false, max_abs_error); | |
| | | } | |
| | | | |
| | | // Creates a matcher that matches any double argument approximately equal t | |
| | | o | |
| | | // rhs, up to the specified max absolute error bound, including NaN values | |
| | | when | |
| | | // rhs is NaN. The max absolute error bound must be non-negative. | |
| | | inline internal::FloatingEqMatcher<double> NanSensitiveDoubleNear( | |
| | | double rhs, double max_abs_error) { | |
| | | return internal::FloatingEqMatcher<double>(rhs, true, max_abs_error); | |
| | | } | |
| | | | |
| // Creates a matcher that matches any float argument approximately | | // Creates a matcher that matches any float argument approximately | |
| // equal to rhs, where two NANs are considered unequal. | | // equal to rhs, where two NANs are considered unequal. | |
| inline internal::FloatingEqMatcher<float> FloatEq(float rhs) { | | inline internal::FloatingEqMatcher<float> FloatEq(float rhs) { | |
| return internal::FloatingEqMatcher<float>(rhs, false); | | return internal::FloatingEqMatcher<float>(rhs, false); | |
| } | | } | |
| | | | |
|
| // Creates a matcher that matches any double argument approximately | | // Creates a matcher that matches any float argument approximately | |
| // equal to rhs, including NaN values when rhs is NaN. | | // equal to rhs, including NaN values when rhs is NaN. | |
| inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) { | | inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) { | |
| return internal::FloatingEqMatcher<float>(rhs, true); | | return internal::FloatingEqMatcher<float>(rhs, true); | |
| } | | } | |
| | | | |
|
| | | // Creates a matcher that matches any float argument approximately equal to | |
| | | // rhs, up to the specified max absolute error bound, where two NANs are | |
| | | // considered unequal. The max absolute error bound must be non-negative. | |
| | | inline internal::FloatingEqMatcher<float> FloatNear( | |
| | | float rhs, float max_abs_error) { | |
| | | return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error); | |
| | | } | |
| | | | |
| | | // Creates a matcher that matches any float argument approximately equal to | |
| | | // rhs, up to the specified max absolute error bound, including NaN values | |
| | | when | |
| | | // rhs is NaN. The max absolute error bound must be non-negative. | |
| | | inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear( | |
| | | float rhs, float max_abs_error) { | |
| | | return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error); | |
| | | } | |
| | | | |
| // Creates a matcher that matches a pointer (raw or smart) that points | | // Creates a matcher that matches a pointer (raw or smart) that points | |
| // to a value that matches inner_matcher. | | // to a value that matches inner_matcher. | |
| template <typename InnerMatcher> | | template <typename InnerMatcher> | |
| inline internal::PointeeMatcher<InnerMatcher> Pointee( | | inline internal::PointeeMatcher<InnerMatcher> Pointee( | |
| const InnerMatcher& inner_matcher) { | | const InnerMatcher& inner_matcher) { | |
| return internal::PointeeMatcher<InnerMatcher>(inner_matcher); | | return internal::PointeeMatcher<InnerMatcher>(inner_matcher); | |
| } | | } | |
| | | | |
| // Creates a matcher that matches an object whose given field matches | | // Creates a matcher that matches an object whose given field matches | |
| // 'matcher'. For example, | | // 'matcher'. For example, | |
| | | | |
| skipping to change at line 2917 | | skipping to change at line 3790 | |
| | | | |
| // Returns a matcher that matches anything that satisfies the given | | // Returns a matcher that matches anything that satisfies the given | |
| // predicate. The predicate can be any unary function or functor | | // predicate. The predicate can be any unary function or functor | |
| // whose return type can be implicitly converted to bool. | | // whose return type can be implicitly converted to bool. | |
| template <typename Predicate> | | template <typename Predicate> | |
| inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> > | | inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> > | |
| Truly(Predicate pred) { | | Truly(Predicate pred) { | |
| return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred)); | | return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred)); | |
| } | | } | |
| | | | |
|
| | | // Returns a matcher that matches the container size. The container must | |
| | | // support both size() and size_type which all STL-like containers provide. | |
| | | // Note that the parameter 'size' can be a value of type size_type as well | |
| | | as | |
| | | // matcher. For instance: | |
| | | // EXPECT_THAT(container, SizeIs(2)); // Checks container has 2 eleme | |
| | | nts. | |
| | | // EXPECT_THAT(container, SizeIs(Le(2)); // Checks container has at most | |
| | | 2. | |
| | | template <typename SizeMatcher> | |
| | | inline internal::SizeIsMatcher<SizeMatcher> | |
| | | SizeIs(const SizeMatcher& size_matcher) { | |
| | | return internal::SizeIsMatcher<SizeMatcher>(size_matcher); | |
| | | } | |
| | | | |
| // Returns a matcher that matches an equal container. | | // Returns a matcher that matches an equal container. | |
| // This matcher behaves like Eq(), but in the event of mismatch lists the | | // This matcher behaves like Eq(), but in the event of mismatch lists the | |
| // values that are included in one container but not the other. (Duplicate | | // values that are included in one container but not the other. (Duplicate | |
| // values and order differences are not explained.) | | // values and order differences are not explained.) | |
| template <typename Container> | | template <typename Container> | |
| inline PolymorphicMatcher<internal::ContainerEqMatcher< // NOLINT | | inline PolymorphicMatcher<internal::ContainerEqMatcher< // NOLINT | |
| GTEST_REMOVE_CONST_(Container)> > | | GTEST_REMOVE_CONST_(Container)> > | |
| ContainerEq(const Container& rhs) { | | ContainerEq(const Container& rhs) { | |
| // This following line is for working around a bug in MSVC 8.0, | | // This following line is for working around a bug in MSVC 8.0, | |
| // which causes Container to be a const type sometimes. | | // which causes Container to be a const type sometimes. | |
| typedef GTEST_REMOVE_CONST_(Container) RawContainer; | | typedef GTEST_REMOVE_CONST_(Container) RawContainer; | |
| return MakePolymorphicMatcher( | | return MakePolymorphicMatcher( | |
| internal::ContainerEqMatcher<RawContainer>(rhs)); | | internal::ContainerEqMatcher<RawContainer>(rhs)); | |
| } | | } | |
| | | | |
|
| | | // Returns a matcher that matches a container that, when sorted using | |
| | | // the given comparator, matches container_matcher. | |
| | | template <typename Comparator, typename ContainerMatcher> | |
| | | inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher> | |
| | | WhenSortedBy(const Comparator& comparator, | |
| | | const ContainerMatcher& container_matcher) { | |
| | | return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>( | |
| | | comparator, container_matcher); | |
| | | } | |
| | | | |
| | | // Returns a matcher that matches a container that, when sorted using | |
| | | // the < operator, matches container_matcher. | |
| | | template <typename ContainerMatcher> | |
| | | inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMat | |
| | | cher> | |
| | | WhenSorted(const ContainerMatcher& container_matcher) { | |
| | | return | |
| | | internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatc | |
| | | her>( | |
| | | internal::LessComparator(), container_matcher); | |
| | | } | |
| | | | |
| // Matches an STL-style container or a native array that contains the | | // Matches an STL-style container or a native array that contains the | |
| // same number of elements as in rhs, where its i-th element and rhs's | | // same number of elements as in rhs, where its i-th element and rhs's | |
| // i-th element (as a pair) satisfy the given pair matcher, for all i. | | // i-th element (as a pair) satisfy the given pair matcher, for all i. | |
| // TupleMatcher must be able to be safely cast to Matcher<tuple<const | | // TupleMatcher must be able to be safely cast to Matcher<tuple<const | |
| // T1&, const T2&> >, where T1 and T2 are the types of elements in the | | // T1&, const T2&> >, where T1 and T2 are the types of elements in the | |
| // LHS container and the RHS container respectively. | | // LHS container and the RHS container respectively. | |
| template <typename TupleMatcher, typename Container> | | template <typename TupleMatcher, typename Container> | |
| inline internal::PointwiseMatcher<TupleMatcher, | | inline internal::PointwiseMatcher<TupleMatcher, | |
| GTEST_REMOVE_CONST_(Container)> | | GTEST_REMOVE_CONST_(Container)> | |
| Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) { | | Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) { | |
| | | | |
| skipping to change at line 3045 | | skipping to change at line 3950 | |
| } | | } | |
| | | | |
| // Matches the value against the given matcher and explains the match | | // Matches the value against the given matcher and explains the match | |
| // result to listener. | | // result to listener. | |
| template <typename T, typename M> | | template <typename T, typename M> | |
| inline bool ExplainMatchResult( | | inline bool ExplainMatchResult( | |
| M matcher, const T& value, MatchResultListener* listener) { | | M matcher, const T& value, MatchResultListener* listener) { | |
| return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener
); | | return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener
); | |
| } | | } | |
| | | | |
|
| | | #if GTEST_LANG_CXX11 | |
| | | // Define variadic matcher versions. They are overloaded in | |
| | | // gmock-generated-matchers.h for the cases supported by pre C++11 compiler | |
| | | s. | |
| | | template <typename... Args> | |
| | | inline internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) { | |
| | | return internal::AllOfMatcher<Args...>(matchers...); | |
| | | } | |
| | | | |
| | | template <typename... Args> | |
| | | inline internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) { | |
| | | return internal::AnyOfMatcher<Args...>(matchers...); | |
| | | } | |
| | | | |
| | | #endif // GTEST_LANG_CXX11 | |
| | | | |
| // AllArgs(m) is a synonym of m. This is useful in | | // AllArgs(m) is a synonym of m. This is useful in | |
| // | | // | |
| // EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq())); | | // EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq())); | |
| // | | // | |
| // which is easier to read than | | // which is easier to read than | |
| // | | // | |
| // EXPECT_CALL(foo, Bar(_, _)).With(Eq()); | | // EXPECT_CALL(foo, Bar(_, _)).With(Eq()); | |
| template <typename InnerMatcher> | | template <typename InnerMatcher> | |
| inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher;
} | | inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher;
} | |
| | | | |
| | | | |
End of changes. 93 change blocks. |
| 217 lines changed or deleted | | 1179 lines changed or added | |
|
| gmock-spec-builders.h | | gmock-spec-builders.h | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 69 | |
| | | | |
| #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ | | #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ | |
| #define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ | | #define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ | |
| | | | |
| #include <map> | | #include <map> | |
| #include <set> | | #include <set> | |
| #include <sstream> | | #include <sstream> | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| | | | |
|
| | | #if GTEST_HAS_EXCEPTIONS | |
| | | # include <stdexcept> // NOLINT | |
| | | #endif | |
| | | | |
| #include "gmock/gmock-actions.h" | | #include "gmock/gmock-actions.h" | |
| #include "gmock/gmock-cardinalities.h" | | #include "gmock/gmock-cardinalities.h" | |
| #include "gmock/gmock-matchers.h" | | #include "gmock/gmock-matchers.h" | |
| #include "gmock/internal/gmock-internal-utils.h" | | #include "gmock/internal/gmock-internal-utils.h" | |
| #include "gmock/internal/gmock-port.h" | | #include "gmock/internal/gmock-port.h" | |
| #include "gtest/gtest.h" | | #include "gtest/gtest.h" | |
| | | | |
| namespace testing { | | namespace testing { | |
| | | | |
| // An abstract handle of an expectation. | | // An abstract handle of an expectation. | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 118 | |
| // mockers, and all expectations. | | // mockers, and all expectations. | |
| // | | // | |
| // The reason we don't use more fine-grained protection is: when a | | // The reason we don't use more fine-grained protection is: when a | |
| // mock function Foo() is called, it needs to consult its expectations | | // mock function Foo() is called, it needs to consult its expectations | |
| // to see which one should be picked. If another thread is allowed to | | // to see which one should be picked. If another thread is allowed to | |
| // call a mock function (either Foo() or a different one) at the same | | // call a mock function (either Foo() or a different one) at the same | |
| // time, it could affect the "retired" attributes of Foo()'s | | // time, it could affect the "retired" attributes of Foo()'s | |
| // expectations when InSequence() is used, and thus affect which | | // expectations when InSequence() is used, and thus affect which | |
| // expectation gets picked. Therefore, we sequence all mock function | | // expectation gets picked. Therefore, we sequence all mock function | |
| // calls to ensure the integrity of the mock objects' states. | | // calls to ensure the integrity of the mock objects' states. | |
|
| GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex); | | GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex); | |
| | | | |
| // Untyped base class for ActionResultHolder<R>. | | // Untyped base class for ActionResultHolder<R>. | |
| class UntypedActionResultHolderBase; | | class UntypedActionResultHolderBase; | |
| | | | |
| // Abstract base class of FunctionMockerBase. This is the | | // Abstract base class of FunctionMockerBase. This is the | |
| // type-agnostic part of the function mocker interface. Its pure | | // type-agnostic part of the function mocker interface. Its pure | |
| // virtual methods are implemented by FunctionMockerBase. | | // virtual methods are implemented by FunctionMockerBase. | |
|
| class UntypedFunctionMockerBase { | | class GTEST_API_ UntypedFunctionMockerBase { | |
| public: | | public: | |
| UntypedFunctionMockerBase(); | | UntypedFunctionMockerBase(); | |
| virtual ~UntypedFunctionMockerBase(); | | virtual ~UntypedFunctionMockerBase(); | |
| | | | |
| // Verifies that all expectations on this mock function have been | | // Verifies that all expectations on this mock function have been | |
| // satisfied. Reports one or more Google Test non-fatal failures | | // satisfied. Reports one or more Google Test non-fatal failures | |
| // and returns false if not. | | // and returns false if not. | |
|
| // L >= g_gmock_mutex | | bool VerifyAndClearExpectationsLocked() | |
| bool VerifyAndClearExpectationsLocked(); | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); | |
| | | | |
| // Clears the ON_CALL()s set on this mock function. | | // Clears the ON_CALL()s set on this mock function. | |
|
| // L >= g_gmock_mutex | | virtual void ClearDefaultActionsLocked() | |
| virtual void ClearDefaultActionsLocked() = 0; | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0; | |
| | | | |
| // In all of the following Untyped* functions, it's the caller's | | // In all of the following Untyped* functions, it's the caller's | |
| // responsibility to guarantee the correctness of the arguments' | | // responsibility to guarantee the correctness of the arguments' | |
| // types. | | // types. | |
| | | | |
| // Performs the default action with the given arguments and returns | | // Performs the default action with the given arguments and returns | |
| // the action's result. The call description string will be used in | | // the action's result. The call description string will be used in | |
| // the error message to describe the call in the case the default | | // the error message to describe the call in the case the default | |
| // action fails. | | // action fails. | |
| // L = * | | // L = * | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 164 | |
| // Performs the given action with the given arguments and returns | | // Performs the given action with the given arguments and returns | |
| // the action's result. | | // the action's result. | |
| // L = * | | // L = * | |
| virtual UntypedActionResultHolderBase* UntypedPerformAction( | | virtual UntypedActionResultHolderBase* UntypedPerformAction( | |
| const void* untyped_action, | | const void* untyped_action, | |
| const void* untyped_args) const = 0; | | const void* untyped_args) const = 0; | |
| | | | |
| // Writes a message that the call is uninteresting (i.e. neither | | // Writes a message that the call is uninteresting (i.e. neither | |
| // explicitly expected nor explicitly unexpected) to the given | | // explicitly expected nor explicitly unexpected) to the given | |
| // ostream. | | // ostream. | |
|
| // L < g_gmock_mutex | | virtual void UntypedDescribeUninterestingCall( | |
| virtual void UntypedDescribeUninterestingCall(const void* untyped_args, | | const void* untyped_args, | |
| ::std::ostream* os) const = | | ::std::ostream* os) const | |
| 0; | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0; | |
| | | | |
| // Returns the expectation that matches the given function arguments | | // Returns the expectation that matches the given function arguments | |
| // (or NULL is there's no match); when a match is found, | | // (or NULL is there's no match); when a match is found, | |
| // untyped_action is set to point to the action that should be | | // untyped_action is set to point to the action that should be | |
| // performed (or NULL if the action is "do default"), and | | // performed (or NULL if the action is "do default"), and | |
| // is_excessive is modified to indicate whether the call exceeds the | | // is_excessive is modified to indicate whether the call exceeds the | |
| // expected number. | | // expected number. | |
|
| // L < g_gmock_mutex | | | |
| virtual const ExpectationBase* UntypedFindMatchingExpectation( | | virtual const ExpectationBase* UntypedFindMatchingExpectation( | |
| const void* untyped_args, | | const void* untyped_args, | |
| const void** untyped_action, bool* is_excessive, | | const void** untyped_action, bool* is_excessive, | |
|
| ::std::ostream* what, ::std::ostream* why) = 0; | | ::std::ostream* what, ::std::ostream* why) | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0; | |
| | | | |
| // Prints the given function arguments to the ostream. | | // Prints the given function arguments to the ostream. | |
| virtual void UntypedPrintArgs(const void* untyped_args, | | virtual void UntypedPrintArgs(const void* untyped_args, | |
| ::std::ostream* os) const = 0; | | ::std::ostream* os) const = 0; | |
| | | | |
| // Sets the mock object this mock method belongs to, and registers | | // Sets the mock object this mock method belongs to, and registers | |
| // this information in the global mock registry. Will be called | | // this information in the global mock registry. Will be called | |
| // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock | | // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock | |
| // method. | | // method. | |
| // TODO(wan@google.com): rename to SetAndRegisterOwner(). | | // TODO(wan@google.com): rename to SetAndRegisterOwner(). | |
|
| // L < g_gmock_mutex | | void RegisterOwner(const void* mock_obj) | |
| void RegisterOwner(const void* mock_obj); | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex); | |
| | | | |
| // Sets the mock object this mock method belongs to, and sets the | | // Sets the mock object this mock method belongs to, and sets the | |
| // name of the mock function. Will be called upon each invocation | | // name of the mock function. Will be called upon each invocation | |
| // of this mock function. | | // of this mock function. | |
|
| // L < g_gmock_mutex | | void SetOwnerAndName(const void* mock_obj, const char* name) | |
| void SetOwnerAndName(const void* mock_obj, const char* name); | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex); | |
| | | | |
| // Returns the mock object this mock method belongs to. Must be | | // Returns the mock object this mock method belongs to. Must be | |
| // called after RegisterOwner() or SetOwnerAndName() has been | | // called after RegisterOwner() or SetOwnerAndName() has been | |
| // called. | | // called. | |
|
| // L < g_gmock_mutex | | const void* MockObject() const | |
| const void* MockObject() const; | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex); | |
| | | | |
| // Returns the name of this mock method. Must be called after | | // Returns the name of this mock method. Must be called after | |
| // SetOwnerAndName() has been called. | | // SetOwnerAndName() has been called. | |
|
| // L < g_gmock_mutex | | const char* Name() const | |
| const char* Name() const; | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex); | |
| | | | |
| // Returns the result of invoking this mock function with the given | | // Returns the result of invoking this mock function with the given | |
| // arguments. This function can be safely called from multiple | | // arguments. This function can be safely called from multiple | |
| // threads concurrently. The caller is responsible for deleting the | | // threads concurrently. The caller is responsible for deleting the | |
| // result. | | // result. | |
|
| // L < g_gmock_mutex | | | |
| const UntypedActionResultHolderBase* UntypedInvokeWith( | | const UntypedActionResultHolderBase* UntypedInvokeWith( | |
|
| const void* untyped_args); | | const void* untyped_args) | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex); | |
| | | | |
| protected: | | protected: | |
| typedef std::vector<const void*> UntypedOnCallSpecs; | | typedef std::vector<const void*> UntypedOnCallSpecs; | |
| | | | |
| typedef std::vector<internal::linked_ptr<ExpectationBase> > | | typedef std::vector<internal::linked_ptr<ExpectationBase> > | |
| UntypedExpectations; | | UntypedExpectations; | |
| | | | |
| // Returns an Expectation object that references and co-owns exp, | | // Returns an Expectation object that references and co-owns exp, | |
| // which must be an expectation on this mock function. | | // which must be an expectation on this mock function. | |
| Expectation GetHandleOf(ExpectationBase* exp); | | Expectation GetHandleOf(ExpectationBase* exp); | |
| | | | |
| skipping to change at line 355 | | skipping to change at line 360 | |
| // source file that contains the statement => file_ | | // source file that contains the statement => file_ | |
| // line number of the statement => line_ | | // line number of the statement => line_ | |
| // matchers => matchers_ | | // matchers => matchers_ | |
| // multi-argument-matcher => extra_matcher_ | | // multi-argument-matcher => extra_matcher_ | |
| // action => action_ | | // action => action_ | |
| ArgumentMatcherTuple matchers_; | | ArgumentMatcherTuple matchers_; | |
| Matcher<const ArgumentTuple&> extra_matcher_; | | Matcher<const ArgumentTuple&> extra_matcher_; | |
| Action<F> action_; | | Action<F> action_; | |
| }; // class OnCallSpec | | }; // class OnCallSpec | |
| | | | |
|
| // Possible reactions on uninteresting calls. TODO(wan@google.com): | | // Possible reactions on uninteresting calls. | |
| // rename the enum values to the kFoo style. | | | |
| enum CallReaction { | | enum CallReaction { | |
|
| ALLOW, | | kAllow, | |
| WARN, | | kWarn, | |
| FAIL | | kFail, | |
| | | kDefault = kWarn // By default, warn about uninteresting calls. | |
| }; | | }; | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
| // Utilities for manipulating mock objects. | | // Utilities for manipulating mock objects. | |
|
| class Mock { | | class GTEST_API_ Mock { | |
| public: | | public: | |
| // The following public methods can be called concurrently. | | // The following public methods can be called concurrently. | |
| | | | |
| // Tells Google Mock to ignore mock_obj when checking for leaked | | // Tells Google Mock to ignore mock_obj when checking for leaked | |
| // mock objects. | | // mock objects. | |
|
| static void AllowLeak(const void* mock_obj); | | static void AllowLeak(const void* mock_obj) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Verifies and clears all expectations on the given mock object. | | // Verifies and clears all expectations on the given mock object. | |
| // If the expectations aren't satisfied, generates one or more | | // If the expectations aren't satisfied, generates one or more | |
| // Google Test non-fatal failures and returns false. | | // Google Test non-fatal failures and returns false. | |
|
| static bool VerifyAndClearExpectations(void* mock_obj); | | static bool VerifyAndClearExpectations(void* mock_obj) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Verifies all expectations on the given mock object and clears its | | // Verifies all expectations on the given mock object and clears its | |
| // default actions and expectations. Returns true iff the | | // default actions and expectations. Returns true iff the | |
| // verification was successful. | | // verification was successful. | |
|
| static bool VerifyAndClear(void* mock_obj); | | static bool VerifyAndClear(void* mock_obj) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| private: | | private: | |
| friend class internal::UntypedFunctionMockerBase; | | friend class internal::UntypedFunctionMockerBase; | |
| | | | |
| // Needed for a function mocker to register itself (so that we know | | // Needed for a function mocker to register itself (so that we know | |
| // how to clear a mock object). | | // how to clear a mock object). | |
| template <typename F> | | template <typename F> | |
| friend class internal::FunctionMockerBase; | | friend class internal::FunctionMockerBase; | |
| | | | |
| template <typename M> | | template <typename M> | |
| friend class NiceMock; | | friend class NiceMock; | |
| | | | |
| template <typename M> | | template <typename M> | |
|
| | | friend class NaggyMock; | |
| | | | |
| | | template <typename M> | |
| friend class StrictMock; | | friend class StrictMock; | |
| | | | |
| // Tells Google Mock to allow uninteresting calls on the given mock | | // Tells Google Mock to allow uninteresting calls on the given mock | |
| // object. | | // object. | |
|
| // L < g_gmock_mutex | | static void AllowUninterestingCalls(const void* mock_obj) | |
| static void AllowUninterestingCalls(const void* mock_obj); | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Tells Google Mock to warn the user about uninteresting calls on | | // Tells Google Mock to warn the user about uninteresting calls on | |
| // the given mock object. | | // the given mock object. | |
|
| // L < g_gmock_mutex | | static void WarnUninterestingCalls(const void* mock_obj) | |
| static void WarnUninterestingCalls(const void* mock_obj); | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Tells Google Mock to fail uninteresting calls on the given mock | | // Tells Google Mock to fail uninteresting calls on the given mock | |
| // object. | | // object. | |
|
| // L < g_gmock_mutex | | static void FailUninterestingCalls(const void* mock_obj) | |
| static void FailUninterestingCalls(const void* mock_obj); | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Tells Google Mock the given mock object is being destroyed and | | // Tells Google Mock the given mock object is being destroyed and | |
| // its entry in the call-reaction table should be removed. | | // its entry in the call-reaction table should be removed. | |
|
| // L < g_gmock_mutex | | static void UnregisterCallReaction(const void* mock_obj) | |
| static void UnregisterCallReaction(const void* mock_obj); | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Returns the reaction Google Mock will have on uninteresting calls | | // Returns the reaction Google Mock will have on uninteresting calls | |
| // made on the given mock object. | | // made on the given mock object. | |
|
| // L < g_gmock_mutex | | | |
| static internal::CallReaction GetReactionOnUninterestingCalls( | | static internal::CallReaction GetReactionOnUninterestingCalls( | |
|
| const void* mock_obj); | | const void* mock_obj) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Verifies that all expectations on the given mock object have been | | // Verifies that all expectations on the given mock object have been | |
| // satisfied. Reports one or more Google Test non-fatal failures | | // satisfied. Reports one or more Google Test non-fatal failures | |
| // and returns false if not. | | // and returns false if not. | |
|
| // L >= g_gmock_mutex | | static bool VerifyAndClearExpectationsLocked(void* mock_obj) | |
| static bool VerifyAndClearExpectationsLocked(void* mock_obj); | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex); | |
| | | | |
| // Clears all ON_CALL()s set on the given mock object. | | // Clears all ON_CALL()s set on the given mock object. | |
|
| // L >= g_gmock_mutex | | static void ClearDefaultActionsLocked(void* mock_obj) | |
| static void ClearDefaultActionsLocked(void* mock_obj); | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex); | |
| | | | |
| // Registers a mock object and a mock method it owns. | | // Registers a mock object and a mock method it owns. | |
|
| // L < g_gmock_mutex | | static void Register( | |
| static void Register(const void* mock_obj, | | const void* mock_obj, | |
| internal::UntypedFunctionMockerBase* mocker); | | internal::UntypedFunctionMockerBase* mocker) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Tells Google Mock where in the source code mock_obj is used in an | | // Tells Google Mock where in the source code mock_obj is used in an | |
| // ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this | | // ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this | |
| // information helps the user identify which object it is. | | // information helps the user identify which object it is. | |
|
| // L < g_gmock_mutex | | | |
| static void RegisterUseByOnCallOrExpectCall( | | static void RegisterUseByOnCallOrExpectCall( | |
|
| const void* mock_obj, const char* file, int line); | | const void* mock_obj, const char* file, int line) | |
| | | GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); | |
| | | | |
| // Unregisters a mock method; removes the owning mock object from | | // Unregisters a mock method; removes the owning mock object from | |
| // the registry when the last mock method associated with it has | | // the registry when the last mock method associated with it has | |
| // been unregistered. This is called only in the destructor of | | // been unregistered. This is called only in the destructor of | |
| // FunctionMockerBase. | | // FunctionMockerBase. | |
|
| // L >= g_gmock_mutex | | static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker) | |
| static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker) | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex); | |
| ; | | | |
| }; // class Mock | | }; // class Mock | |
| | | | |
| // An abstract handle of an expectation. Useful in the .After() | | // An abstract handle of an expectation. Useful in the .After() | |
| // clause of EXPECT_CALL() for setting the (partial) order of | | // clause of EXPECT_CALL() for setting the (partial) order of | |
| // expectations. The syntax: | | // expectations. The syntax: | |
| // | | // | |
| // Expectation e1 = EXPECT_CALL(...)...; | | // Expectation e1 = EXPECT_CALL(...)...; | |
| // EXPECT_CALL(...).After(e1)...; | | // EXPECT_CALL(...).After(e1)...; | |
| // | | // | |
| // sets two expectations where the latter can only be matched after | | // sets two expectations where the latter can only be matched after | |
| | | | |
| skipping to change at line 474 | | skipping to change at line 487 | |
| // - This class is copyable and has value semantics. | | // - This class is copyable and has value semantics. | |
| // - Constness is shallow: a const Expectation object itself cannot | | // - Constness is shallow: a const Expectation object itself cannot | |
| // be modified, but the mutable methods of the ExpectationBase | | // be modified, but the mutable methods of the ExpectationBase | |
| // object it references can be called via expectation_base(). | | // object it references can be called via expectation_base(). | |
| // - The constructors and destructor are defined out-of-line because | | // - The constructors and destructor are defined out-of-line because | |
| // the Symbian WINSCW compiler wants to otherwise instantiate them | | // the Symbian WINSCW compiler wants to otherwise instantiate them | |
| // when it sees this class definition, at which point it doesn't have | | // when it sees this class definition, at which point it doesn't have | |
| // ExpectationBase available yet, leading to incorrect destruction | | // ExpectationBase available yet, leading to incorrect destruction | |
| // in the linked_ptr (or compilation errors if using a checking | | // in the linked_ptr (or compilation errors if using a checking | |
| // linked_ptr). | | // linked_ptr). | |
|
| class Expectation { | | class GTEST_API_ Expectation { | |
| public: | | public: | |
| // Constructs a null object that doesn't reference any expectation. | | // Constructs a null object that doesn't reference any expectation. | |
| Expectation(); | | Expectation(); | |
| | | | |
| ~Expectation(); | | ~Expectation(); | |
| | | | |
| // This single-argument ctor must not be explicit, in order to support th
e | | // This single-argument ctor must not be explicit, in order to support th
e | |
| // Expectation e = EXPECT_CALL(...); | | // Expectation e = EXPECT_CALL(...); | |
| // syntax. | | // syntax. | |
| // | | // | |
| | | | |
| skipping to change at line 605 | | skipping to change at line 618 | |
| const_iterator begin() const { return expectations_.begin(); } | | const_iterator begin() const { return expectations_.begin(); } | |
| const_iterator end() const { return expectations_.end(); } | | const_iterator end() const { return expectations_.end(); } | |
| | | | |
| private: | | private: | |
| Expectation::Set expectations_; | | Expectation::Set expectations_; | |
| }; | | }; | |
| | | | |
| // Sequence objects are used by a user to specify the relative order | | // Sequence objects are used by a user to specify the relative order | |
| // in which the expectations should match. They are copyable (we rely | | // in which the expectations should match. They are copyable (we rely | |
| // on the compiler-defined copy constructor and assignment operator). | | // on the compiler-defined copy constructor and assignment operator). | |
|
| class Sequence { | | class GTEST_API_ Sequence { | |
| public: | | public: | |
| // Constructs an empty sequence. | | // Constructs an empty sequence. | |
| Sequence() : last_expectation_(new Expectation) {} | | Sequence() : last_expectation_(new Expectation) {} | |
| | | | |
| // Adds an expectation to this sequence. The caller must ensure | | // Adds an expectation to this sequence. The caller must ensure | |
| // that no other thread is accessing this Sequence object. | | // that no other thread is accessing this Sequence object. | |
| void AddExpectation(const Expectation& expectation) const; | | void AddExpectation(const Expectation& expectation) const; | |
| | | | |
| private: | | private: | |
| // The last expectation in this sequence. We use a linked_ptr here | | // The last expectation in this sequence. We use a linked_ptr here | |
| | | | |
| skipping to change at line 646 | | skipping to change at line 659 | |
| // ... | | // ... | |
| // EXPECT_CALL(b, Xyz())...; | | // EXPECT_CALL(b, Xyz())...; | |
| // } | | // } | |
| // | | // | |
| // You can create InSequence objects in multiple threads, as long as | | // You can create InSequence objects in multiple threads, as long as | |
| // they are used to affect different mock objects. The idea is that | | // they are used to affect different mock objects. The idea is that | |
| // each thread can create and set up its own mocks as if it's the only | | // each thread can create and set up its own mocks as if it's the only | |
| // thread. However, for clarity of your tests we recommend you to set | | // thread. However, for clarity of your tests we recommend you to set | |
| // up mocks in the main thread unless you have a good reason not to do | | // up mocks in the main thread unless you have a good reason not to do | |
| // so. | | // so. | |
|
| class InSequence { | | class GTEST_API_ InSequence { | |
| public: | | public: | |
| InSequence(); | | InSequence(); | |
| ~InSequence(); | | ~InSequence(); | |
| private: | | private: | |
| bool sequence_created_; | | bool sequence_created_; | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence); // NOLINT | | GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence); // NOLINT | |
| } GTEST_ATTRIBUTE_UNUSED_; | | } GTEST_ATTRIBUTE_UNUSED_; | |
| | | | |
| namespace internal { | | namespace internal { | |
| | | | |
| // Points to the implicit sequence introduced by a living InSequence | | // Points to the implicit sequence introduced by a living InSequence | |
| // object (if any) in the current thread or NULL. | | // object (if any) in the current thread or NULL. | |
|
| extern ThreadLocal<Sequence*> g_gmock_implicit_sequence; | | GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence; | |
| | | | |
| // Base class for implementing expectations. | | // Base class for implementing expectations. | |
| // | | // | |
| // There are two reasons for having a type-agnostic base class for | | // There are two reasons for having a type-agnostic base class for | |
| // Expectation: | | // Expectation: | |
| // | | // | |
| // 1. We need to store collections of expectations of different | | // 1. We need to store collections of expectations of different | |
| // types (e.g. all pre-requisites of a particular expectation, all | | // types (e.g. all pre-requisites of a particular expectation, all | |
| // expectations in a sequence). Therefore these expectation objects | | // expectations in a sequence). Therefore these expectation objects | |
| // must share a common base class. | | // must share a common base class. | |
| // | | // | |
| // 2. We can avoid binary code bloat by moving methods not depending | | // 2. We can avoid binary code bloat by moving methods not depending | |
| // on the template argument of Expectation to the base class. | | // on the template argument of Expectation to the base class. | |
| // | | // | |
| // This class is internal and mustn't be used by user code directly. | | // This class is internal and mustn't be used by user code directly. | |
|
| class ExpectationBase { | | class GTEST_API_ ExpectationBase { | |
| public: | | public: | |
| // source_text is the EXPECT_CALL(...) source that created this Expectati
on. | | // source_text is the EXPECT_CALL(...) source that created this Expectati
on. | |
| ExpectationBase(const char* file, int line, const string& source_text); | | ExpectationBase(const char* file, int line, const string& source_text); | |
| | | | |
| virtual ~ExpectationBase(); | | virtual ~ExpectationBase(); | |
| | | | |
| // Where in the source file was the expectation spec defined? | | // Where in the source file was the expectation spec defined? | |
| const char* file() const { return file_; } | | const char* file() const { return file_; } | |
| int line() const { return line_; } | | int line() const { return line_; } | |
| const char* source_text() const { return source_text_.c_str(); } | | const char* source_text() const { return source_text_.c_str(); } | |
| // Returns the cardinality specified in the expectation spec. | | // Returns the cardinality specified in the expectation spec. | |
| const Cardinality& cardinality() const { return cardinality_; } | | const Cardinality& cardinality() const { return cardinality_; } | |
| | | | |
| // Describes the source file location of this expectation. | | // Describes the source file location of this expectation. | |
| void DescribeLocationTo(::std::ostream* os) const { | | void DescribeLocationTo(::std::ostream* os) const { | |
| *os << FormatFileLocation(file(), line()) << " "; | | *os << FormatFileLocation(file(), line()) << " "; | |
| } | | } | |
| | | | |
| // Describes how many times a function call matching this | | // Describes how many times a function call matching this | |
| // expectation has occurred. | | // expectation has occurred. | |
|
| // L >= g_gmock_mutex | | void DescribeCallCountTo(::std::ostream* os) const | |
| void DescribeCallCountTo(::std::ostream* os) const; | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); | |
| | | | |
| // If this mock method has an extra matcher (i.e. .With(matcher)), | | // If this mock method has an extra matcher (i.e. .With(matcher)), | |
| // describes it to the ostream. | | // describes it to the ostream. | |
| virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0; | | virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0; | |
| | | | |
| protected: | | protected: | |
| friend class ::testing::Expectation; | | friend class ::testing::Expectation; | |
| friend class UntypedFunctionMockerBase; | | friend class UntypedFunctionMockerBase; | |
| | | | |
| enum Clause { | | enum Clause { | |
| | | | |
| skipping to change at line 754 | | skipping to change at line 767 | |
| // Sets the cardinality of this expectation spec. | | // Sets the cardinality of this expectation spec. | |
| void set_cardinality(const Cardinality& a_cardinality) { | | void set_cardinality(const Cardinality& a_cardinality) { | |
| cardinality_ = a_cardinality; | | cardinality_ = a_cardinality; | |
| } | | } | |
| | | | |
| // The following group of methods should only be called after the | | // The following group of methods should only be called after the | |
| // EXPECT_CALL() statement, and only when g_gmock_mutex is held by | | // EXPECT_CALL() statement, and only when g_gmock_mutex is held by | |
| // the current thread. | | // the current thread. | |
| | | | |
| // Retires all pre-requisites of this expectation. | | // Retires all pre-requisites of this expectation. | |
|
| // L >= g_gmock_mutex | | void RetireAllPreRequisites() | |
| void RetireAllPreRequisites(); | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); | |
| | | | |
| // Returns true iff this expectation is retired. | | // Returns true iff this expectation is retired. | |
|
| // L >= g_gmock_mutex | | bool is_retired() const | |
| bool is_retired() const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return retired_; | | return retired_; | |
| } | | } | |
| | | | |
| // Retires this expectation. | | // Retires this expectation. | |
|
| // L >= g_gmock_mutex | | void Retire() | |
| void Retire() { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| retired_ = true; | | retired_ = true; | |
| } | | } | |
| | | | |
| // Returns true iff this expectation is satisfied. | | // Returns true iff this expectation is satisfied. | |
|
| // L >= g_gmock_mutex | | bool IsSatisfied() const | |
| bool IsSatisfied() const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return cardinality().IsSatisfiedByCallCount(call_count_); | | return cardinality().IsSatisfiedByCallCount(call_count_); | |
| } | | } | |
| | | | |
| // Returns true iff this expectation is saturated. | | // Returns true iff this expectation is saturated. | |
|
| // L >= g_gmock_mutex | | bool IsSaturated() const | |
| bool IsSaturated() const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return cardinality().IsSaturatedByCallCount(call_count_); | | return cardinality().IsSaturatedByCallCount(call_count_); | |
| } | | } | |
| | | | |
| // Returns true iff this expectation is over-saturated. | | // Returns true iff this expectation is over-saturated. | |
|
| // L >= g_gmock_mutex | | bool IsOverSaturated() const | |
| bool IsOverSaturated() const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return cardinality().IsOverSaturatedByCallCount(call_count_); | | return cardinality().IsOverSaturatedByCallCount(call_count_); | |
| } | | } | |
| | | | |
| // Returns true iff all pre-requisites of this expectation are satisfied. | | // Returns true iff all pre-requisites of this expectation are satisfied. | |
|
| // L >= g_gmock_mutex | | bool AllPrerequisitesAreSatisfied() const | |
| bool AllPrerequisitesAreSatisfied() const; | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); | |
| | | | |
| // Adds unsatisfied pre-requisites of this expectation to 'result'. | | // Adds unsatisfied pre-requisites of this expectation to 'result'. | |
|
| // L >= g_gmock_mutex | | void FindUnsatisfiedPrerequisites(ExpectationSet* result) const | |
| void FindUnsatisfiedPrerequisites(ExpectationSet* result) const; | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); | |
| | | | |
| // Returns the number this expectation has been invoked. | | // Returns the number this expectation has been invoked. | |
|
| // L >= g_gmock_mutex | | int call_count() const | |
| int call_count() const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return call_count_; | | return call_count_; | |
| } | | } | |
| | | | |
| // Increments the number this expectation has been invoked. | | // Increments the number this expectation has been invoked. | |
|
| // L >= g_gmock_mutex | | void IncrementCallCount() | |
| void IncrementCallCount() { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| call_count_++; | | call_count_++; | |
| } | | } | |
| | | | |
| // Checks the action count (i.e. the number of WillOnce() and | | // Checks the action count (i.e. the number of WillOnce() and | |
| // WillRepeatedly() clauses) against the cardinality if this hasn't | | // WillRepeatedly() clauses) against the cardinality if this hasn't | |
| // been done before. Prints a warning if there are too many or too | | // been done before. Prints a warning if there are too many or too | |
| // few actions. | | // few actions. | |
|
| // L < mutex_ | | void CheckActionCountIfNotDone() const | |
| void CheckActionCountIfNotDone() const; | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| | | | |
| friend class ::testing::Sequence; | | friend class ::testing::Sequence; | |
| friend class ::testing::internal::ExpectationTester; | | friend class ::testing::internal::ExpectationTester; | |
| | | | |
| template <typename Function> | | template <typename Function> | |
| friend class TypedExpectation; | | friend class TypedExpectation; | |
| | | | |
| // Implements the .Times() clause. | | // Implements the .Times() clause. | |
| void UntypedTimes(const Cardinality& a_cardinality); | | void UntypedTimes(const Cardinality& a_cardinality); | |
| | | | |
| | | | |
| skipping to change at line 1071 | | skipping to change at line 1084 | |
| // expectation. | | // expectation. | |
| virtual Expectation GetHandle() { | | virtual Expectation GetHandle() { | |
| return owner_->GetHandleOf(this); | | return owner_->GetHandleOf(this); | |
| } | | } | |
| | | | |
| // The following methods will be called only after the EXPECT_CALL() | | // The following methods will be called only after the EXPECT_CALL() | |
| // statement finishes and when the current thread holds | | // statement finishes and when the current thread holds | |
| // g_gmock_mutex. | | // g_gmock_mutex. | |
| | | | |
| // Returns true iff this expectation matches the given arguments. | | // Returns true iff this expectation matches the given arguments. | |
|
| // L >= g_gmock_mutex | | bool Matches(const ArgumentTuple& args) const | |
| bool Matches(const ArgumentTuple& args) const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| return TupleMatches(matchers_, args) && extra_matcher_.Matches(args); | | return TupleMatches(matchers_, args) && extra_matcher_.Matches(args); | |
| } | | } | |
| | | | |
| // Returns true iff this expectation should handle the given arguments. | | // Returns true iff this expectation should handle the given arguments. | |
|
| // L >= g_gmock_mutex | | bool ShouldHandleArguments(const ArgumentTuple& args) const | |
| bool ShouldHandleArguments(const ArgumentTuple& args) const { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| | | | |
| // In case the action count wasn't checked when the expectation | | // In case the action count wasn't checked when the expectation | |
| // was defined (e.g. if this expectation has no WillRepeatedly() | | // was defined (e.g. if this expectation has no WillRepeatedly() | |
| // or RetiresOnSaturation() clause), we check it when the | | // or RetiresOnSaturation() clause), we check it when the | |
| // expectation is used for the first time. | | // expectation is used for the first time. | |
| CheckActionCountIfNotDone(); | | CheckActionCountIfNotDone(); | |
| return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args)
; | | return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args)
; | |
| } | | } | |
| | | | |
| // Describes the result of matching the arguments against this | | // Describes the result of matching the arguments against this | |
| // expectation to the given ostream. | | // expectation to the given ostream. | |
|
| // L >= g_gmock_mutex | | void ExplainMatchResultTo( | |
| void ExplainMatchResultTo(const ArgumentTuple& args, | | const ArgumentTuple& args, | |
| ::std::ostream* os) const { | | ::std::ostream* os) const | |
| | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| | | | |
| if (is_retired()) { | | if (is_retired()) { | |
| *os << " Expected: the expectation is active\n" | | *os << " Expected: the expectation is active\n" | |
| << " Actual: it is retired\n"; | | << " Actual: it is retired\n"; | |
| } else if (!Matches(args)) { | | } else if (!Matches(args)) { | |
| if (!TupleMatches(matchers_, args)) { | | if (!TupleMatches(matchers_, args)) { | |
| ExplainMatchFailureTupleTo(matchers_, args, os); | | ExplainMatchFailureTupleTo(matchers_, args, os); | |
| } | | } | |
| StringMatchResultListener listener; | | StringMatchResultListener listener; | |
| | | | |
| skipping to change at line 1136 | | skipping to change at line 1150 | |
| } else { | | } else { | |
| // This line is here just for completeness' sake. It will never | | // This line is here just for completeness' sake. It will never | |
| // be executed as currently the ExplainMatchResultTo() function | | // be executed as currently the ExplainMatchResultTo() function | |
| // is called only when the mock function call does NOT match the | | // is called only when the mock function call does NOT match the | |
| // expectation. | | // expectation. | |
| *os << "The call matches the expectation.\n"; | | *os << "The call matches the expectation.\n"; | |
| } | | } | |
| } | | } | |
| | | | |
| // Returns the action that should be taken for the current invocation. | | // Returns the action that should be taken for the current invocation. | |
|
| // L >= g_gmock_mutex | | const Action<F>& GetCurrentAction( | |
| const Action<F>& GetCurrentAction(const FunctionMockerBase<F>* mocker, | | const FunctionMockerBase<F>* mocker, | |
| const ArgumentTuple& args) const { | | const ArgumentTuple& args) const | |
| | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| const int count = call_count(); | | const int count = call_count(); | |
| Assert(count >= 1, __FILE__, __LINE__, | | Assert(count >= 1, __FILE__, __LINE__, | |
| "call_count() is <= 0 when GetCurrentAction() is " | | "call_count() is <= 0 when GetCurrentAction() is " | |
| "called - this should never happen."); | | "called - this should never happen."); | |
| | | | |
| const int action_count = static_cast<int>(untyped_actions_.size()); | | const int action_count = static_cast<int>(untyped_actions_.size()); | |
| if (action_count > 0 && !repeated_action_specified_ && | | if (action_count > 0 && !repeated_action_specified_ && | |
| count > action_count) { | | count > action_count) { | |
| // If there is at least one WillOnce() and no WillRepeatedly(), | | // If there is at least one WillOnce() and no WillRepeatedly(), | |
| // we warn the user when the WillOnce() clauses ran out. | | // we warn the user when the WillOnce() clauses ran out. | |
| ::std::stringstream ss; | | ::std::stringstream ss; | |
| DescribeLocationTo(&ss); | | DescribeLocationTo(&ss); | |
| ss << "Actions ran out in " << source_text() << "...\n" | | ss << "Actions ran out in " << source_text() << "...\n" | |
| << "Called " << count << " times, but only " | | << "Called " << count << " times, but only " | |
| << action_count << " WillOnce()" | | << action_count << " WillOnce()" | |
| << (action_count == 1 ? " is" : "s are") << " specified - "; | | << (action_count == 1 ? " is" : "s are") << " specified - "; | |
| mocker->DescribeDefaultActionTo(args, &ss); | | mocker->DescribeDefaultActionTo(args, &ss); | |
|
| Log(WARNING, ss.str(), 1); | | Log(kWarning, ss.str(), 1); | |
| } | | } | |
| | | | |
| return count <= action_count ? | | return count <= action_count ? | |
| *static_cast<const Action<F>*>(untyped_actions_[count - 1]) : | | *static_cast<const Action<F>*>(untyped_actions_[count - 1]) : | |
| repeated_action(); | | repeated_action(); | |
| } | | } | |
| | | | |
| // Given the arguments of a mock function call, if the call will | | // Given the arguments of a mock function call, if the call will | |
| // over-saturate this expectation, returns the default action; | | // over-saturate this expectation, returns the default action; | |
| // otherwise, returns the next action in this expectation. Also | | // otherwise, returns the next action in this expectation. Also | |
| // describes *what* happened to 'what', and explains *why* Google | | // describes *what* happened to 'what', and explains *why* Google | |
| // Mock does it to 'why'. This method is not const as it calls | | // Mock does it to 'why'. This method is not const as it calls | |
| // IncrementCallCount(). A return value of NULL means the default | | // IncrementCallCount(). A return value of NULL means the default | |
| // action. | | // action. | |
|
| // L >= g_gmock_mutex | | const Action<F>* GetActionForArguments( | |
| const Action<F>* GetActionForArguments(const FunctionMockerBase<F>* mocke | | const FunctionMockerBase<F>* mocker, | |
| r, | | const ArgumentTuple& args, | |
| const ArgumentTuple& args, | | ::std::ostream* what, | |
| ::std::ostream* what, | | ::std::ostream* why) | |
| ::std::ostream* why) { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| if (IsSaturated()) { | | if (IsSaturated()) { | |
| // We have an excessive call. | | // We have an excessive call. | |
| IncrementCallCount(); | | IncrementCallCount(); | |
| *what << "Mock function called more times than expected - "; | | *what << "Mock function called more times than expected - "; | |
| mocker->DescribeDefaultActionTo(args, what); | | mocker->DescribeDefaultActionTo(args, what); | |
| DescribeCallCountTo(why); | | DescribeCallCountTo(why); | |
| | | | |
| // TODO(wan@google.com): allow the user to control whether | | // TODO(wan@google.com): allow the user to control whether | |
| // unexpected calls should fail immediately or continue using a | | // unexpected calls should fail immediately or continue using a | |
| | | | |
| skipping to change at line 1224 | | skipping to change at line 1240 | |
| // specifying the default behavior of, or expectation on, a mock | | // specifying the default behavior of, or expectation on, a mock | |
| // function. | | // function. | |
| | | | |
| // Note: class MockSpec really belongs to the ::testing namespace. | | // Note: class MockSpec really belongs to the ::testing namespace. | |
| // However if we define it in ::testing, MSVC will complain when | | // However if we define it in ::testing, MSVC will complain when | |
| // classes in ::testing::internal declare it as a friend class | | // classes in ::testing::internal declare it as a friend class | |
| // template. To workaround this compiler bug, we define MockSpec in | | // template. To workaround this compiler bug, we define MockSpec in | |
| // ::testing::internal and import it into ::testing. | | // ::testing::internal and import it into ::testing. | |
| | | | |
| // Logs a message including file and line number information. | | // Logs a message including file and line number information. | |
|
| void LogWithLocation(testing::internal::LogSeverity severity, | | GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity, | |
| const char* file, int line, | | const char* file, int line, | |
| const string& message); | | const string& message); | |
| | | | |
| template <typename F> | | template <typename F> | |
| class MockSpec { | | class MockSpec { | |
| public: | | public: | |
| typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; | | typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; | |
| typedef typename internal::Function<F>::ArgumentMatcherTuple | | typedef typename internal::Function<F>::ArgumentMatcherTuple | |
| ArgumentMatcherTuple; | | ArgumentMatcherTuple; | |
| | | | |
| // Constructs a MockSpec object, given the function mocker object | | // Constructs a MockSpec object, given the function mocker object | |
| // that the spec is associated with. | | // that the spec is associated with. | |
| explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker) | | explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker) | |
| : function_mocker_(function_mocker) {} | | : function_mocker_(function_mocker) {} | |
| | | | |
| // Adds a new default action spec to the function mocker and returns | | // Adds a new default action spec to the function mocker and returns | |
| // the newly created spec. | | // the newly created spec. | |
| internal::OnCallSpec<F>& InternalDefaultActionSetAt( | | internal::OnCallSpec<F>& InternalDefaultActionSetAt( | |
| const char* file, int line, const char* obj, const char* call) { | | const char* file, int line, const char* obj, const char* call) { | |
|
| LogWithLocation(internal::INFO, file, line, | | LogWithLocation(internal::kInfo, file, line, | |
| string("ON_CALL(") + obj + ", " + call + ") invoked"); | | string("ON_CALL(") + obj + ", " + call + ") invoked"); | |
| return function_mocker_->AddNewOnCallSpec(file, line, matchers_); | | return function_mocker_->AddNewOnCallSpec(file, line, matchers_); | |
| } | | } | |
| | | | |
| // Adds a new expectation spec to the function mocker and returns | | // Adds a new expectation spec to the function mocker and returns | |
| // the newly created spec. | | // the newly created spec. | |
| internal::TypedExpectation<F>& InternalExpectedAt( | | internal::TypedExpectation<F>& InternalExpectedAt( | |
| const char* file, int line, const char* obj, const char* call) { | | const char* file, int line, const char* obj, const char* call) { | |
| const string source_text(string("EXPECT_CALL(") + obj + ", " + call + "
)"); | | const string source_text(string("EXPECT_CALL(") + obj + ", " + call + "
)"); | |
|
| LogWithLocation(internal::INFO, file, line, source_text + " invoked"); | | LogWithLocation(internal::kInfo, file, line, source_text + " invoked"); | |
| return function_mocker_->AddNewExpectation( | | return function_mocker_->AddNewExpectation( | |
| file, line, source_text, matchers_); | | file, line, source_text, matchers_); | |
| } | | } | |
| | | | |
| private: | | private: | |
| template <typename Function> | | template <typename Function> | |
| friend class internal::FunctionMocker; | | friend class internal::FunctionMocker; | |
| | | | |
| void SetMatchers(const ArgumentMatcherTuple& matchers) { | | void SetMatchers(const ArgumentMatcherTuple& matchers) { | |
| matchers_ = matchers; | | matchers_ = matchers; | |
| | | | |
| skipping to change at line 1395 | | skipping to change at line 1411 | |
| public: | | public: | |
| typedef typename Function<F>::Result Result; | | typedef typename Function<F>::Result Result; | |
| typedef typename Function<F>::ArgumentTuple ArgumentTuple; | | typedef typename Function<F>::ArgumentTuple ArgumentTuple; | |
| typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple; | | typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple; | |
| | | | |
| FunctionMockerBase() : current_spec_(this) {} | | FunctionMockerBase() : current_spec_(this) {} | |
| | | | |
| // The destructor verifies that all expectations on this mock | | // The destructor verifies that all expectations on this mock | |
| // function have been satisfied. If not, it will report Google Test | | // function have been satisfied. If not, it will report Google Test | |
| // non-fatal failures for the violations. | | // non-fatal failures for the violations. | |
|
| // L < g_gmock_mutex | | virtual ~FunctionMockerBase() | |
| virtual ~FunctionMockerBase() { | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| MutexLock l(&g_gmock_mutex); | | MutexLock l(&g_gmock_mutex); | |
| VerifyAndClearExpectationsLocked(); | | VerifyAndClearExpectationsLocked(); | |
| Mock::UnregisterLocked(this); | | Mock::UnregisterLocked(this); | |
| ClearDefaultActionsLocked(); | | ClearDefaultActionsLocked(); | |
| } | | } | |
| | | | |
| // Returns the ON_CALL spec that matches this mock function with the | | // Returns the ON_CALL spec that matches this mock function with the | |
| // given arguments; returns NULL if no matching ON_CALL is found. | | // given arguments; returns NULL if no matching ON_CALL is found. | |
| // L = * | | // L = * | |
| const OnCallSpec<F>* FindOnCallSpec( | | const OnCallSpec<F>* FindOnCallSpec( | |
| | | | |
| skipping to change at line 1419 | | skipping to change at line 1435 | |
| = untyped_on_call_specs_.rbegin(); | | = untyped_on_call_specs_.rbegin(); | |
| it != untyped_on_call_specs_.rend(); ++it) { | | it != untyped_on_call_specs_.rend(); ++it) { | |
| const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it); | | const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it); | |
| if (spec->Matches(args)) | | if (spec->Matches(args)) | |
| return spec; | | return spec; | |
| } | | } | |
| | | | |
| return NULL; | | return NULL; | |
| } | | } | |
| | | | |
|
| // Performs the default action of this mock function on the given argumen | | // Performs the default action of this mock function on the given | |
| ts | | // arguments and returns the result. Asserts (or throws if | |
| // and returns the result. Asserts with a helpful call descrption if ther | | // exceptions are enabled) with a helpful call descrption if there | |
| e is | | // is no valid return value. This method doesn't depend on the | |
| // no valid return value. This method doesn't depend on the mutable state | | // mutable state of this object, and thus can be called concurrently | |
| of | | // without locking. | |
| // this object, and thus can be called concurrently without locking. | | | |
| // L = * | | // L = * | |
| Result PerformDefaultAction(const ArgumentTuple& args, | | Result PerformDefaultAction(const ArgumentTuple& args, | |
| const string& call_description) const { | | const string& call_description) const { | |
| const OnCallSpec<F>* const spec = | | const OnCallSpec<F>* const spec = | |
| this->FindOnCallSpec(args); | | this->FindOnCallSpec(args); | |
| if (spec != NULL) { | | if (spec != NULL) { | |
| return spec->GetAction().Perform(args); | | return spec->GetAction().Perform(args); | |
| } | | } | |
|
| Assert(DefaultValue<Result>::Exists(), "", -1, | | const string message = call_description + | |
| call_description + "\n The mock function has no default actio | | "\n The mock function has no default action " | |
| n " | | "set, and its return type has no default value set."; | |
| "set, and its return type has no default value set."); | | #if GTEST_HAS_EXCEPTIONS | |
| | | if (!DefaultValue<Result>::Exists()) { | |
| | | throw std::runtime_error(message); | |
| | | } | |
| | | #else | |
| | | Assert(DefaultValue<Result>::Exists(), "", -1, message); | |
| | | #endif | |
| return DefaultValue<Result>::Get(); | | return DefaultValue<Result>::Get(); | |
| } | | } | |
| | | | |
| // Performs the default action with the given arguments and returns | | // Performs the default action with the given arguments and returns | |
| // the action's result. The call description string will be used in | | // the action's result. The call description string will be used in | |
| // the error message to describe the call in the case the default | | // the error message to describe the call in the case the default | |
| // action fails. The caller is responsible for deleting the result. | | // action fails. The caller is responsible for deleting the result. | |
| // L = * | | // L = * | |
| virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction( | | virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction( | |
| const void* untyped_args, // must point to an ArgumentTuple | | const void* untyped_args, // must point to an ArgumentTuple | |
| | | | |
| skipping to change at line 1466 | | skipping to change at line 1491 | |
| // Make a copy of the action before performing it, in case the | | // Make a copy of the action before performing it, in case the | |
| // action deletes the mock object (and thus deletes itself). | | // action deletes the mock object (and thus deletes itself). | |
| const Action<F> action = *static_cast<const Action<F>*>(untyped_action)
; | | const Action<F> action = *static_cast<const Action<F>*>(untyped_action)
; | |
| const ArgumentTuple& args = | | const ArgumentTuple& args = | |
| *static_cast<const ArgumentTuple*>(untyped_args); | | *static_cast<const ArgumentTuple*>(untyped_args); | |
| return ResultHolder::PerformAction(action, args); | | return ResultHolder::PerformAction(action, args); | |
| } | | } | |
| | | | |
| // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): | | // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): | |
| // clears the ON_CALL()s set on this mock function. | | // clears the ON_CALL()s set on this mock function. | |
|
| // L >= g_gmock_mutex | | virtual void ClearDefaultActionsLocked() | |
| virtual void ClearDefaultActionsLocked() { | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
|
| | | | |
| | | // Deleting our default actions may trigger other mock objects to be | |
| | | // deleted, for example if an action contains a reference counted smart | |
| | | // pointer to that mock object, and that is the last reference. So if w | |
| | | e | |
| | | // delete our actions within the context of the global mutex we may dea | |
| | | dlock | |
| | | // when this method is called again. Instead, make a copy of the set of | |
| | | // actions to delete, clear our set within the mutex, and then delete t | |
| | | he | |
| | | // actions outside of the mutex. | |
| | | UntypedOnCallSpecs specs_to_delete; | |
| | | untyped_on_call_specs_.swap(specs_to_delete); | |
| | | | |
| | | g_gmock_mutex.Unlock(); | |
| for (UntypedOnCallSpecs::const_iterator it = | | for (UntypedOnCallSpecs::const_iterator it = | |
|
| untyped_on_call_specs_.begin(); | | specs_to_delete.begin(); | |
| it != untyped_on_call_specs_.end(); ++it) { | | it != specs_to_delete.end(); ++it) { | |
| delete static_cast<const OnCallSpec<F>*>(*it); | | delete static_cast<const OnCallSpec<F>*>(*it); | |
| } | | } | |
|
| untyped_on_call_specs_.clear(); | | | |
| | | // Lock the mutex again, since the caller expects it to be locked when | |
| | | we | |
| | | // return. | |
| | | g_gmock_mutex.Lock(); | |
| } | | } | |
| | | | |
| protected: | | protected: | |
| template <typename Function> | | template <typename Function> | |
| friend class MockSpec; | | friend class MockSpec; | |
| | | | |
| typedef ActionResultHolder<Result> ResultHolder; | | typedef ActionResultHolder<Result> ResultHolder; | |
| | | | |
| // Returns the result of invoking this mock function with the given | | // Returns the result of invoking this mock function with the given | |
| // arguments. This function can be safely called from multiple | | // arguments. This function can be safely called from multiple | |
| // threads concurrently. | | // threads concurrently. | |
|
| // L < g_gmock_mutex | | Result InvokeWith(const ArgumentTuple& args) | |
| Result InvokeWith(const ArgumentTuple& args) { | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| return static_cast<const ResultHolder*>( | | return static_cast<const ResultHolder*>( | |
| this->UntypedInvokeWith(&args))->GetValueAndDelete(); | | this->UntypedInvokeWith(&args))->GetValueAndDelete(); | |
| } | | } | |
| | | | |
| // Adds and returns a default action spec for this mock function. | | // Adds and returns a default action spec for this mock function. | |
|
| // L < g_gmock_mutex | | | |
| OnCallSpec<F>& AddNewOnCallSpec( | | OnCallSpec<F>& AddNewOnCallSpec( | |
| const char* file, int line, | | const char* file, int line, | |
|
| const ArgumentMatcherTuple& m) { | | const ArgumentMatcherTuple& m) | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line); | | Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line); | |
| OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m); | | OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m); | |
| untyped_on_call_specs_.push_back(on_call_spec); | | untyped_on_call_specs_.push_back(on_call_spec); | |
| return *on_call_spec; | | return *on_call_spec; | |
| } | | } | |
| | | | |
| // Adds and returns an expectation spec for this mock function. | | // Adds and returns an expectation spec for this mock function. | |
|
| // L < g_gmock_mutex | | | |
| TypedExpectation<F>& AddNewExpectation( | | TypedExpectation<F>& AddNewExpectation( | |
| const char* file, | | const char* file, | |
| int line, | | int line, | |
| const string& source_text, | | const string& source_text, | |
|
| const ArgumentMatcherTuple& m) { | | const ArgumentMatcherTuple& m) | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line); | | Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line); | |
| TypedExpectation<F>* const expectation = | | TypedExpectation<F>* const expectation = | |
| new TypedExpectation<F>(this, file, line, source_text, m); | | new TypedExpectation<F>(this, file, line, source_text, m); | |
| const linked_ptr<ExpectationBase> untyped_expectation(expectation); | | const linked_ptr<ExpectationBase> untyped_expectation(expectation); | |
| untyped_expectations_.push_back(untyped_expectation); | | untyped_expectations_.push_back(untyped_expectation); | |
| | | | |
| // Adds this expectation into the implicit sequence if there is one. | | // Adds this expectation into the implicit sequence if there is one. | |
| Sequence* const implicit_sequence = g_gmock_implicit_sequence.get(); | | Sequence* const implicit_sequence = g_gmock_implicit_sequence.get(); | |
| if (implicit_sequence != NULL) { | | if (implicit_sequence != NULL) { | |
| implicit_sequence->AddExpectation(Expectation(untyped_expectation)); | | implicit_sequence->AddExpectation(Expectation(untyped_expectation)); | |
| | | | |
| skipping to change at line 1554 | | skipping to change at line 1594 | |
| "returning default value.\n"); | | "returning default value.\n"); | |
| } else { | | } else { | |
| *os << "taking default action specified at:\n" | | *os << "taking default action specified at:\n" | |
| << FormatFileLocation(spec->file(), spec->line()) << "\n"; | | << FormatFileLocation(spec->file(), spec->line()) << "\n"; | |
| } | | } | |
| } | | } | |
| | | | |
| // Writes a message that the call is uninteresting (i.e. neither | | // Writes a message that the call is uninteresting (i.e. neither | |
| // explicitly expected nor explicitly unexpected) to the given | | // explicitly expected nor explicitly unexpected) to the given | |
| // ostream. | | // ostream. | |
|
| // L < g_gmock_mutex | | virtual void UntypedDescribeUninterestingCall( | |
| virtual void UntypedDescribeUninterestingCall(const void* untyped_args, | | const void* untyped_args, | |
| ::std::ostream* os) const { | | ::std::ostream* os) const | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| const ArgumentTuple& args = | | const ArgumentTuple& args = | |
| *static_cast<const ArgumentTuple*>(untyped_args); | | *static_cast<const ArgumentTuple*>(untyped_args); | |
| *os << "Uninteresting mock function call - "; | | *os << "Uninteresting mock function call - "; | |
| DescribeDefaultActionTo(args, os); | | DescribeDefaultActionTo(args, os); | |
| *os << " Function call: " << Name(); | | *os << " Function call: " << Name(); | |
| UniversalPrint(args, os); | | UniversalPrint(args, os); | |
| } | | } | |
| | | | |
| // Returns the expectation that matches the given function arguments | | // Returns the expectation that matches the given function arguments | |
| // (or NULL is there's no match); when a match is found, | | // (or NULL is there's no match); when a match is found, | |
| | | | |
| skipping to change at line 1581 | | skipping to change at line 1622 | |
| // | | // | |
| // Critical section: We must find the matching expectation and the | | // Critical section: We must find the matching expectation and the | |
| // corresponding action that needs to be taken in an ATOMIC | | // corresponding action that needs to be taken in an ATOMIC | |
| // transaction. Otherwise another thread may call this mock | | // transaction. Otherwise another thread may call this mock | |
| // method in the middle and mess up the state. | | // method in the middle and mess up the state. | |
| // | | // | |
| // However, performing the action has to be left out of the critical | | // However, performing the action has to be left out of the critical | |
| // section. The reason is that we have no control on what the | | // section. The reason is that we have no control on what the | |
| // action does (it can invoke an arbitrary user function or even a | | // action does (it can invoke an arbitrary user function or even a | |
| // mock function) and excessive locking could cause a dead lock. | | // mock function) and excessive locking could cause a dead lock. | |
|
| // L < g_gmock_mutex | | | |
| virtual const ExpectationBase* UntypedFindMatchingExpectation( | | virtual const ExpectationBase* UntypedFindMatchingExpectation( | |
| const void* untyped_args, | | const void* untyped_args, | |
| const void** untyped_action, bool* is_excessive, | | const void** untyped_action, bool* is_excessive, | |
|
| ::std::ostream* what, ::std::ostream* why) { | | ::std::ostream* what, ::std::ostream* why) | |
| | | GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { | |
| const ArgumentTuple& args = | | const ArgumentTuple& args = | |
| *static_cast<const ArgumentTuple*>(untyped_args); | | *static_cast<const ArgumentTuple*>(untyped_args); | |
| MutexLock l(&g_gmock_mutex); | | MutexLock l(&g_gmock_mutex); | |
| TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args); | | TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args); | |
| if (exp == NULL) { // A match wasn't found. | | if (exp == NULL) { // A match wasn't found. | |
| this->FormatUnexpectedCallMessageLocked(args, what, why); | | this->FormatUnexpectedCallMessageLocked(args, what, why); | |
| return NULL; | | return NULL; | |
| } | | } | |
| | | | |
| // This line must be done before calling GetActionForArguments(), | | // This line must be done before calling GetActionForArguments(), | |
| | | | |
| skipping to change at line 1616 | | skipping to change at line 1657 | |
| // Prints the given function arguments to the ostream. | | // Prints the given function arguments to the ostream. | |
| virtual void UntypedPrintArgs(const void* untyped_args, | | virtual void UntypedPrintArgs(const void* untyped_args, | |
| ::std::ostream* os) const { | | ::std::ostream* os) const { | |
| const ArgumentTuple& args = | | const ArgumentTuple& args = | |
| *static_cast<const ArgumentTuple*>(untyped_args); | | *static_cast<const ArgumentTuple*>(untyped_args); | |
| UniversalPrint(args, os); | | UniversalPrint(args, os); | |
| } | | } | |
| | | | |
| // Returns the expectation that matches the arguments, or NULL if no | | // Returns the expectation that matches the arguments, or NULL if no | |
| // expectation matches them. | | // expectation matches them. | |
|
| // L >= g_gmock_mutex | | | |
| TypedExpectation<F>* FindMatchingExpectationLocked( | | TypedExpectation<F>* FindMatchingExpectationLocked( | |
|
| const ArgumentTuple& args) const { | | const ArgumentTuple& args) const | |
| | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| for (typename UntypedExpectations::const_reverse_iterator it = | | for (typename UntypedExpectations::const_reverse_iterator it = | |
| untyped_expectations_.rbegin(); | | untyped_expectations_.rbegin(); | |
| it != untyped_expectations_.rend(); ++it) { | | it != untyped_expectations_.rend(); ++it) { | |
| TypedExpectation<F>* const exp = | | TypedExpectation<F>* const exp = | |
| static_cast<TypedExpectation<F>*>(it->get()); | | static_cast<TypedExpectation<F>*>(it->get()); | |
| if (exp->ShouldHandleArguments(args)) { | | if (exp->ShouldHandleArguments(args)) { | |
| return exp; | | return exp; | |
| } | | } | |
| } | | } | |
| return NULL; | | return NULL; | |
| } | | } | |
| | | | |
| // Returns a message that the arguments don't match any expectation. | | // Returns a message that the arguments don't match any expectation. | |
|
| // L >= g_gmock_mutex | | void FormatUnexpectedCallMessageLocked( | |
| void FormatUnexpectedCallMessageLocked(const ArgumentTuple& args, | | const ArgumentTuple& args, | |
| ::std::ostream* os, | | ::std::ostream* os, | |
| ::std::ostream* why) const { | | ::std::ostream* why) const | |
| | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| *os << "\nUnexpected mock function call - "; | | *os << "\nUnexpected mock function call - "; | |
| DescribeDefaultActionTo(args, os); | | DescribeDefaultActionTo(args, os); | |
| PrintTriedExpectationsLocked(args, why); | | PrintTriedExpectationsLocked(args, why); | |
| } | | } | |
| | | | |
| // Prints a list of expectations that have been tried against the | | // Prints a list of expectations that have been tried against the | |
| // current mock function call. | | // current mock function call. | |
|
| // L >= g_gmock_mutex | | void PrintTriedExpectationsLocked( | |
| void PrintTriedExpectationsLocked(const ArgumentTuple& args, | | const ArgumentTuple& args, | |
| ::std::ostream* why) const { | | ::std::ostream* why) const | |
| | | GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { | |
| g_gmock_mutex.AssertHeld(); | | g_gmock_mutex.AssertHeld(); | |
| const int count = static_cast<int>(untyped_expectations_.size()); | | const int count = static_cast<int>(untyped_expectations_.size()); | |
| *why << "Google Mock tried the following " << count << " " | | *why << "Google Mock tried the following " << count << " " | |
| << (count == 1 ? "expectation, but it didn't match" : | | << (count == 1 ? "expectation, but it didn't match" : | |
| "expectations, but none matched") | | "expectations, but none matched") | |
| << ":\n"; | | << ":\n"; | |
| for (int i = 0; i < count; i++) { | | for (int i = 0; i < count; i++) { | |
| TypedExpectation<F>* const expectation = | | TypedExpectation<F>* const expectation = | |
| static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get())
; | | static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get())
; | |
| *why << "\n"; | | *why << "\n"; | |
| | | | |
| skipping to change at line 1696 | | skipping to change at line 1739 | |
| | | | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| # pragma warning(pop) // Restores the warning state. | | # pragma warning(pop) // Restores the warning state. | |
| #endif // _MSV_VER | | #endif // _MSV_VER | |
| | | | |
| // Implements methods of FunctionMockerBase. | | // Implements methods of FunctionMockerBase. | |
| | | | |
| // Verifies that all expectations on this mock function have been | | // Verifies that all expectations on this mock function have been | |
| // satisfied. Reports one or more Google Test non-fatal failures and | | // satisfied. Reports one or more Google Test non-fatal failures and | |
| // returns false if not. | | // returns false if not. | |
|
| // L >= g_gmock_mutex | | | |
| | | | |
| // Reports an uninteresting call (whose description is in msg) in the | | // Reports an uninteresting call (whose description is in msg) in the | |
| // manner specified by 'reaction'. | | // manner specified by 'reaction'. | |
| void ReportUninterestingCall(CallReaction reaction, const string& msg); | | void ReportUninterestingCall(CallReaction reaction, const string& msg); | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
| // The style guide prohibits "using" statements in a namespace scope | | // The style guide prohibits "using" statements in a namespace scope | |
| // inside a header file. However, the MockSpec class template is | | // inside a header file. However, the MockSpec class template is | |
| // meant to be defined in the ::testing namespace. The following line | | // meant to be defined in the ::testing namespace. The following line | |
| | | | |
End of changes. 79 change blocks. |
| 143 lines changed or deleted | | 182 lines changed or added | |
|
| gtest-param-util-generated.h | | gtest-param-util-generated.h | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 98 | |
| const T1 v1_; | | const T1 v1_; | |
| }; | | }; | |
| | | | |
| template <typename T1, typename T2> | | template <typename T1, typename T2> | |
| class ValueArray2 { | | class ValueArray2 { | |
| public: | | public: | |
| ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} | | ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray2& other); | | void operator=(const ValueArray2& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| }; | | }; | |
| | | | |
| template <typename T1, typename T2, typename T3> | | template <typename T1, typename T2, typename T3> | |
| class ValueArray3 { | | class ValueArray3 { | |
| public: | | public: | |
| ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} | | ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray3& other); | | void operator=(const ValueArray3& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| }; | | }; | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4> | | template <typename T1, typename T2, typename T3, typename T4> | |
| class ValueArray4 { | | class ValueArray4 { | |
| public: | | public: | |
| ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), | | ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), | |
| v4_(v4) {} | | v4_(v4) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray4& other); | | void operator=(const ValueArray4& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 162 | |
| }; | | }; | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5> | | template <typename T1, typename T2, typename T3, typename T4, typename T5> | |
| class ValueArray5 { | | class ValueArray5 { | |
| public: | | public: | |
| ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3
), | | ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3
), | |
| v4_(v4), v5_(v5) {} | | v4_(v4), v5_(v5) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray5& other); | | void operator=(const ValueArray5& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 184 | | skipping to change at line 187 | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6> | | typename T6> | |
| class ValueArray6 { | | class ValueArray6 { | |
| public: | | public: | |
| ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), | | ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), | |
| v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} | | v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray6& other); | | void operator=(const ValueArray6& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 209 | | skipping to change at line 214 | |
| | | | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7> | | typename T6, typename T7> | |
| class ValueArray7 { | | class ValueArray7 { | |
| public: | | public: | |
| ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), | | ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), | |
| v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} | | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_), static_cast<T>(v7_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray7& other); | | void operator=(const ValueArray7& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 236 | | skipping to change at line 243 | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8> | | typename T6, typename T7, typename T8> | |
| class ValueArray8 { | | class ValueArray8 { | |
| public: | | public: | |
| ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | | ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | |
| T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7
), | | T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7
), | |
| v8_(v8) {} | | v8_(v8) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray8& other); | | void operator=(const ValueArray8& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 273 | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8, typename T9> | | typename T6, typename T7, typename T8, typename T9> | |
| class ValueArray9 { | | class ValueArray9 { | |
| public: | | public: | |
| ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, | | ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, | |
| T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7
), | | T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7
), | |
| v8_(v8), v9_(v9) {} | | v8_(v8), v9_(v9) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray9& other); | | void operator=(const ValueArray9& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 293 | | skipping to change at line 305 | |
| template <typename T1, typename T2, typename T3, typename T4, typename T5, | | template <typename T1, typename T2, typename T3, typename T4, typename T5, | |
| typename T6, typename T7, typename T8, typename T9, typename T10> | | typename T6, typename T7, typename T8, typename T9, typename T10> | |
| class ValueArray10 { | | class ValueArray10 { | |
| public: | | public: | |
| ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10) {} | | v8_(v8), v9_(v9), v10_(v10) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_}; | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray10& other); | | void operator=(const ValueArray10& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 324 | | skipping to change at line 339 | |
| typename T6, typename T7, typename T8, typename T9, typename T10, | | typename T6, typename T7, typename T8, typename T9, typename T10, | |
| typename T11> | | typename T11> | |
| class ValueArray11 { | | class ValueArray11 { | |
| public: | | public: | |
| ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | | T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | |
| v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} | | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_}; | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray11& other); | | void operator=(const ValueArray11& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 356 | | skipping to change at line 374 | |
| typename T6, typename T7, typename T8, typename T9, typename T10, | | typename T6, typename T7, typename T8, typename T9, typename T10, | |
| typename T11, typename T12> | | typename T11, typename T12> | |
| class ValueArray12 { | | class ValueArray12 { | |
| public: | | public: | |
| ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | | T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | |
| v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {
} | | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {
} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray12& other); | | void operator=(const ValueArray12& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 391 | | skipping to change at line 412 | |
| typename T11, typename T12, typename T13> | | typename T11, typename T12, typename T13> | |
| class ValueArray13 { | | class ValueArray13 { | |
| public: | | public: | |
| ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | | T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | |
| v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | |
| v12_(v12), v13_(v13) {} | | v12_(v12), v13_(v13) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray13& other); | | void operator=(const ValueArray13& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 427 | | skipping to change at line 451 | |
| typename T11, typename T12, typename T13, typename T14> | | typename T11, typename T12, typename T13, typename T14> | |
| class ValueArray14 { | | class ValueArray14 { | |
| public: | | public: | |
| ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(
v3), | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(
v3), | |
| v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} | | v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray14& other); | | void operator=(const ValueArray14& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 464 | | skipping to change at line 491 | |
| typename T11, typename T12, typename T13, typename T14, typename T15> | | typename T11, typename T12, typename T13, typename T14, typename T15> | |
| class ValueArray15 { | | class ValueArray15 { | |
| public: | | public: | |
| ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(
v2), | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(
v2), | |
| v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray15& other); | | void operator=(const ValueArray15& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 504 | | skipping to change at line 535 | |
| class ValueArray16 { | | class ValueArray16 { | |
| public: | | public: | |
| ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(
v1), | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(
v1), | |
| v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | |
| v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | |
| v16_(v16) {} | | v16_(v16) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray16& other); | | void operator=(const ValueArray16& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 545 | | skipping to change at line 580 | |
| class ValueArray17 { | | class ValueArray17 { | |
| public: | | public: | |
| ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, | |
| T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17) {} | | v15_(v15), v16_(v16), v17_(v17) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray17& other); | | void operator=(const ValueArray17& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 587 | | skipping to change at line 626 | |
| class ValueArray18 { | | class ValueArray18 { | |
| public: | | public: | |
| ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} | | v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray18& other); | | void operator=(const ValueArray18& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 630 | | skipping to change at line 674 | |
| class ValueArray19 { | | class ValueArray19 { | |
| public: | | public: | |
| ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | | T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | |
| v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | |
| v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} | | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray19& other); | | void operator=(const ValueArray19& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 675 | | skipping to change at line 724 | |
| public: | | public: | |
| ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | | T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | |
| v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | |
| v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | |
| v19_(v19), v20_(v20) {} | | v19_(v19), v20_(v20) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray20& other); | | void operator=(const ValueArray20& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 722 | | skipping to change at line 776 | |
| public: | | public: | |
| ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | | T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | |
| v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | |
| v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | |
| v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} | | v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray21& other); | | void operator=(const ValueArray21& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 770 | | skipping to change at line 830 | |
| public: | | public: | |
| ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(
v3), | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(
v3), | |
| v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_}; | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray22& other); | | void operator=(const ValueArray22& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 820 | | skipping to change at line 886 | |
| ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(
v2), | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(
v2), | |
| v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23) {} | | v23_(v23) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| v23_}; | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray23& other); | | void operator=(const ValueArray23& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 872 | | skipping to change at line 943 | |
| ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(
v1), | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(
v1), | |
| v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | |
| v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | |
| v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | |
| v22_(v22), v23_(v23), v24_(v24) {} | | v22_(v22), v23_(v23), v24_(v24) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray24& other); | | void operator=(const ValueArray24& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 925 | | skipping to change at line 1002 | |
| ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, | |
| T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray25& other); | | void operator=(const ValueArray25& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 980 | | skipping to change at line 1063 | |
| ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | | ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v
9, | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray26& other); | | void operator=(const ValueArray26& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1037 | | skipping to change at line 1126 | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | | T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | |
| v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | |
| v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | |
| v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | |
| v26_(v26), v27_(v27) {} | | v26_(v26), v27_(v27) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray27& other); | | void operator=(const ValueArray27& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1095 | | skipping to change at line 1191 | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | | T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | |
| v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | |
| v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | |
| v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | |
| v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} | | v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray28& other); | | void operator=(const ValueArray28& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1154 | | skipping to change at line 1257 | |
| T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v1
7, | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | | T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | |
| v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | |
| v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | |
| v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | |
| v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} | | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray29& other); | | void operator=(const ValueArray29& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1215 | | skipping to change at line 1325 | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(
v3), | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(
v3), | |
| v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30) {} | | v29_(v29), v30_(v30) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray30& other); | | void operator=(const ValueArray30& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1278 | | skipping to change at line 1396 | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(
v2), | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(
v2), | |
| v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30), v31_(v31) {} | | v29_(v29), v30_(v30), v31_(v31) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray31& other); | | void operator=(const ValueArray31& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1342 | | skipping to change at line 1468 | |
| T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v2
5, | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(
v1), | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(
v1), | |
| v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | |
| v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | |
| v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | |
| v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | |
| v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} | | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray32& other); | | void operator=(const ValueArray32& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1408 | | skipping to change at line 1542 | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, | |
| T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33) {} | | v33_(v33) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray33& other); | | void operator=(const ValueArray33& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1475 | | skipping to change at line 1618 | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | |
| T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33), v34_(v34) {} | | v33_(v33), v34_(v34) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_}; | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray34& other); | | void operator=(const ValueArray34& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1543 | | skipping to change at line 1695 | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | |
| T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | | T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | |
| v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | |
| v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | |
| v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | |
| v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), | | v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), | |
| v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} | | v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| v35_}; | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray35& other); | | void operator=(const ValueArray35& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1614 | | skipping to change at line 1774 | |
| T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v3
3, | |
| T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | | T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(
v5), | |
| v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | |
| v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | |
| v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | |
| v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), | | v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), | |
| v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} | | v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray36& other); | | void operator=(const ValueArray36& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1687 | | skipping to change at line 1856 | |
| T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | | T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(
v4), | |
| v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | |
| v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | |
| v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | |
| v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), | | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), | |
| v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), | | v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), | |
| v36_(v36), v37_(v37) {} | | v36_(v36), v37_(v37) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray37& other); | | void operator=(const ValueArray37& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1761 | | skipping to change at line 1939 | |
| T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(
v3), | | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(
v3), | |
| v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | |
| v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} | | v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray38& other); | | void operator=(const ValueArray38& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1836 | | skipping to change at line 2023 | |
| T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(
v2), | | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(
v2), | |
| v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v
10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | |
| v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} | | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray39& other); | | void operator=(const ValueArray39& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1913 | | skipping to change at line 2110 | |
| v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9
), | |
| v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | |
| v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | |
| v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | |
| v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), | | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), | |
| v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), | | v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), | |
| v40_(v40) {} | | v40_(v40) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray40& other); | | void operator=(const ValueArray40& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 1992 | | skipping to change at line 2199 | |
| T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | |
| v39_(v39), v40_(v40), v41_(v41) {} | | v39_(v39), v40_(v40), v41_(v41) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray41& other); | | void operator=(const ValueArray41& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2072 | | skipping to change at line 2289 | |
| T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | | T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(
v7), | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | |
| v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} | | v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray42& other); | | void operator=(const ValueArray42& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2153 | | skipping to change at line 2381 | |
| T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | | T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(
v6), | |
| v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13)
, | |
| v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), | |
| v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), | |
| v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), | | v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), | |
| v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), | | v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), | |
| v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} | | v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray43& other); | | void operator=(const ValueArray43& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2236 | | skipping to change at line 2475 | |
| v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), | |
| v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), | |
| v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), | |
| v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), | | v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), | |
| v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), | | v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), | |
| v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), | | v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), | |
| v43_(v43), v44_(v44) {} | | v43_(v43), v44_(v44) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray44& other); | | void operator=(const ValueArray44& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2320 | | skipping to change at line 2570 | |
| v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), | |
| v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), | |
| v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), | |
| v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), | | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), | |
| v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), | | v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), | |
| v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), | | v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), | |
| v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} | | v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray45& other); | | void operator=(const ValueArray45& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2406 | | skipping to change at line 2668 | |
| v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | |
| v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), | | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), | |
| v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} | | v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_}; | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_), static_cast<T>(v46_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray46& other); | | void operator=(const ValueArray46& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2494 | | skipping to change at line 2768 | |
| v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), | |
| v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), | |
| v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), | |
| v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), | |
| v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), | | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), | |
| v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), | | v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), | |
| v47_(v47) {} | | v47_(v47) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| v47_}; | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray47& other); | | void operator=(const ValueArray47& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2584 | | skipping to change at line 2869 | |
| v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), | |
| v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), | |
| v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), | |
| v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), | | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), | |
| v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), | | v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), | |
| v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), | | v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), | |
| v46_(v46), v47_(v47), v48_(v48) {} | | v46_(v46), v47_(v47), v48_(v48) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| 47_, | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| v48_}; | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), | |
| | | static_cast<T>(v48_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray48& other); | | void operator=(const ValueArray48& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2675 | | skipping to change at line 2972 | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | |
| v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), | | v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), | |
| v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} | | v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| 47_, | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| v48_, v49_}; | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), | |
| | | static_cast<T>(v48_), static_cast<T>(v49_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray49& other); | | void operator=(const ValueArray49& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
| skipping to change at line 2767 | | skipping to change at line 3076 | |
| v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v1
4), | |
| v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), | |
| v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), | |
| v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), | |
| v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), | |
| v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), | | v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), | |
| v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} | | v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} | |
| | | | |
| template <typename T> | | template <typename T> | |
| operator ParamGenerator<T>() const { | | operator ParamGenerator<T>() const { | |
|
| const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v | | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), | |
| 11_, | | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), | |
| v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v | | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), | |
| 23_, | | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), | |
| v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v | | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), | |
| 35_, | | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), | |
| v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v | | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), | |
| 47_, | | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), | |
| v48_, v49_, v50_}; | | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), | |
| | | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), | |
| | | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), | |
| | | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), | |
| | | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), | |
| | | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), | |
| | | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), | |
| | | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), | |
| | | static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)}; | |
| return ValuesIn(array); | | return ValuesIn(array); | |
| } | | } | |
| | | | |
| private: | | private: | |
| // No implementation - assignment is unsupported. | | // No implementation - assignment is unsupported. | |
| void operator=(const ValueArray50& other); | | void operator=(const ValueArray50& other); | |
| | | | |
| const T1 v1_; | | const T1 v1_; | |
| const T2 v2_; | | const T2 v2_; | |
| const T3 v3_; | | const T3 v3_; | |
| | | | |
End of changes. 49 change blocks. |
| 221 lines changed or deleted | | 457 lines changed or added | |
|
| gtest-port.h | | gtest-port.h | |
| | | | |
| skipping to change at line 35 | | skipping to change at line 35 | |
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| // | | // | |
| // Authors: wan@google.com (Zhanyong Wan) | | // Authors: wan@google.com (Zhanyong Wan) | |
| // | | // | |
| // Low-level types and utilities for porting Google Test to various | | // Low-level types and utilities for porting Google Test to various | |
| // platforms. They are subject to change without notice. DO NOT USE | | // platforms. They are subject to change without notice. DO NOT USE | |
| // THEM IN USER CODE. | | // THEM IN USER CODE. | |
|
| | | // | |
| | | // This file is fundamental to Google Test. All other Google Test source | |
| | | // files are expected to #include this. Therefore, it cannot #include | |
| | | // any other Google Test header. | |
| | | | |
| #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ | | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ | |
| #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ | | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ | |
| | | | |
| // The user can define the following macros in the build script to | | // The user can define the following macros in the build script to | |
| // control Google Test's behavior. If the user doesn't define a macro | | // control Google Test's behavior. If the user doesn't define a macro | |
| // in this list, Google Test will define it. | | // in this list, Google Test will define it. | |
| // | | // | |
| // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) | | // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) | |
| // is/isn't available. | | // is/isn't available. | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 79 | |
| // compiler supports Microsoft's "Structured | | // compiler supports Microsoft's "Structured | |
| // Exception Handling". | | // Exception Handling". | |
| // GTEST_HAS_STREAM_REDIRECTION | | // GTEST_HAS_STREAM_REDIRECTION | |
| // - Define it to 1/0 to indicate whether the | | // - Define it to 1/0 to indicate whether the | |
| // platform supports I/O stream redirection us
ing | | // platform supports I/O stream redirection us
ing | |
| // dup() and dup2(). | | // dup() and dup2(). | |
| // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google | | // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google | |
| // Test's own tr1 tuple implementation should
be | | // Test's own tr1 tuple implementation should
be | |
| // used. Unused when the user sets | | // used. Unused when the user sets | |
| // GTEST_HAS_TR1_TUPLE to 0. | | // GTEST_HAS_TR1_TUPLE to 0. | |
|
| | | // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Te | |
| | | st | |
| | | // is building in C++11/C++98 mode. | |
| // GTEST_LINKED_AS_SHARED_LIBRARY | | // GTEST_LINKED_AS_SHARED_LIBRARY | |
| // - Define to 1 when compiling tests that use | | // - Define to 1 when compiling tests that use | |
| // Google Test as a shared library (known as | | // Google Test as a shared library (known as | |
| // DLL on Windows). | | // DLL on Windows). | |
| // GTEST_CREATE_SHARED_LIBRARY | | // GTEST_CREATE_SHARED_LIBRARY | |
| // - Define to 1 when compiling Google Test itse
lf | | // - Define to 1 when compiling Google Test itse
lf | |
| // as a shared library. | | // as a shared library. | |
| | | | |
| // This header defines the following utilities: | | // This header defines the following utilities: | |
| // | | // | |
| // Macros indicating the current platform (defined to 1 if compiled on | | // Macros indicating the current platform (defined to 1 if compiled on | |
| // the given platform; otherwise undefined): | | // the given platform; otherwise undefined): | |
| // GTEST_OS_AIX - IBM AIX | | // GTEST_OS_AIX - IBM AIX | |
| // GTEST_OS_CYGWIN - Cygwin | | // GTEST_OS_CYGWIN - Cygwin | |
| // GTEST_OS_HPUX - HP-UX | | // GTEST_OS_HPUX - HP-UX | |
| // GTEST_OS_LINUX - Linux | | // GTEST_OS_LINUX - Linux | |
| // GTEST_OS_LINUX_ANDROID - Google Android | | // GTEST_OS_LINUX_ANDROID - Google Android | |
| // GTEST_OS_MAC - Mac OS X | | // GTEST_OS_MAC - Mac OS X | |
|
| | | // GTEST_OS_IOS - iOS | |
| | | // GTEST_OS_IOS_SIMULATOR - iOS simulator | |
| // GTEST_OS_NACL - Google Native Client (NaCl) | | // GTEST_OS_NACL - Google Native Client (NaCl) | |
|
| | | // GTEST_OS_OPENBSD - OpenBSD | |
| | | // GTEST_OS_QNX - QNX | |
| // GTEST_OS_SOLARIS - Sun Solaris | | // GTEST_OS_SOLARIS - Sun Solaris | |
| // GTEST_OS_SYMBIAN - Symbian | | // GTEST_OS_SYMBIAN - Symbian | |
| // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) | | // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) | |
| // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop | | // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop | |
| // GTEST_OS_WINDOWS_MINGW - MinGW | | // GTEST_OS_WINDOWS_MINGW - MinGW | |
| // GTEST_OS_WINDOWS_MOBILE - Windows Mobile | | // GTEST_OS_WINDOWS_MOBILE - Windows Mobile | |
| // GTEST_OS_ZOS - z/OS | | // GTEST_OS_ZOS - z/OS | |
| // | | // | |
| // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the | | // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the | |
| // most stable support. Since core members of the Google Test project | | // most stable support. Since core members of the Google Test project | |
| | | | |
| skipping to change at line 178 | | skipping to change at line 188 | |
| // Integer types: | | // Integer types: | |
| // TypeWithSize - maps an integer to a int type. | | // TypeWithSize - maps an integer to a int type. | |
| // Int32, UInt32, Int64, UInt64, TimeInMillis | | // Int32, UInt32, Int64, UInt64, TimeInMillis | |
| // - integers of known sizes. | | // - integers of known sizes. | |
| // BiggestInt - the biggest signed integer type. | | // BiggestInt - the biggest signed integer type. | |
| // | | // | |
| // Command-line utilities: | | // Command-line utilities: | |
| // GTEST_FLAG() - references a flag. | | // GTEST_FLAG() - references a flag. | |
| // GTEST_DECLARE_*() - declares a flag. | | // GTEST_DECLARE_*() - declares a flag. | |
| // GTEST_DEFINE_*() - defines a flag. | | // GTEST_DEFINE_*() - defines a flag. | |
|
| // GetArgvs() - returns the command line as a vector of strings. | | // GetInjectableArgvs() - returns the command line as a vector of strings
. | |
| // | | // | |
| // Environment variable utilities: | | // Environment variable utilities: | |
| // GetEnv() - gets the value of an environment variable. | | // GetEnv() - gets the value of an environment variable. | |
| // BoolFromGTestEnv() - parses a bool environment variable. | | // BoolFromGTestEnv() - parses a bool environment variable. | |
| // Int32FromGTestEnv() - parses an Int32 environment variable. | | // Int32FromGTestEnv() - parses an Int32 environment variable. | |
| // StringFromGTestEnv() - parses a string environment variable. | | // StringFromGTestEnv() - parses a string environment variable. | |
| | | | |
| #include <ctype.h> // for isspace, etc | | #include <ctype.h> // for isspace, etc | |
| #include <stddef.h> // for ptrdiff_t | | #include <stddef.h> // for ptrdiff_t | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <string.h> | | #include <string.h> | |
| #ifndef _WIN32_WCE | | #ifndef _WIN32_WCE | |
| # include <sys/types.h> | | # include <sys/types.h> | |
| # include <sys/stat.h> | | # include <sys/stat.h> | |
| #endif // !_WIN32_WCE | | #endif // !_WIN32_WCE | |
| | | | |
|
| | | #if defined __APPLE__ | |
| | | # include <AvailabilityMacros.h> | |
| | | # include <TargetConditionals.h> | |
| | | #endif | |
| | | | |
| #include <iostream> // NOLINT | | #include <iostream> // NOLINT | |
| #include <sstream> // NOLINT | | #include <sstream> // NOLINT | |
| #include <string> // NOLINT | | #include <string> // NOLINT | |
| | | | |
| #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" | | #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" | |
| #define GTEST_FLAG_PREFIX_ "gtest_" | | #define GTEST_FLAG_PREFIX_ "gtest_" | |
| #define GTEST_FLAG_PREFIX_DASH_ "gtest-" | | #define GTEST_FLAG_PREFIX_DASH_ "gtest-" | |
| #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" | | #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" | |
| #define GTEST_NAME_ "Google Test" | | #define GTEST_NAME_ "Google Test" | |
| #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" | | #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" | |
| | | | |
| skipping to change at line 230 | | skipping to change at line 245 | |
| # define GTEST_OS_WINDOWS 1 | | # define GTEST_OS_WINDOWS 1 | |
| # ifdef _WIN32_WCE | | # ifdef _WIN32_WCE | |
| # define GTEST_OS_WINDOWS_MOBILE 1 | | # define GTEST_OS_WINDOWS_MOBILE 1 | |
| # elif defined(__MINGW__) || defined(__MINGW32__) | | # elif defined(__MINGW__) || defined(__MINGW32__) | |
| # define GTEST_OS_WINDOWS_MINGW 1 | | # define GTEST_OS_WINDOWS_MINGW 1 | |
| # else | | # else | |
| # define GTEST_OS_WINDOWS_DESKTOP 1 | | # define GTEST_OS_WINDOWS_DESKTOP 1 | |
| # endif // _WIN32_WCE | | # endif // _WIN32_WCE | |
| #elif defined __APPLE__ | | #elif defined __APPLE__ | |
| # define GTEST_OS_MAC 1 | | # define GTEST_OS_MAC 1 | |
|
| | | # if TARGET_OS_IPHONE | |
| | | # define GTEST_OS_IOS 1 | |
| | | # if TARGET_IPHONE_SIMULATOR | |
| | | # define GTEST_OS_IOS_SIMULATOR 1 | |
| | | # endif | |
| | | # endif | |
| #elif defined __linux__ | | #elif defined __linux__ | |
| # define GTEST_OS_LINUX 1 | | # define GTEST_OS_LINUX 1 | |
|
| # ifdef ANDROID | | # if defined __ANDROID__ | |
| # define GTEST_OS_LINUX_ANDROID 1 | | # define GTEST_OS_LINUX_ANDROID 1 | |
|
| # endif // ANDROID | | # endif | |
| #elif defined __MVS__ | | #elif defined __MVS__ | |
| # define GTEST_OS_ZOS 1 | | # define GTEST_OS_ZOS 1 | |
| #elif defined(__sun) && defined(__SVR4) | | #elif defined(__sun) && defined(__SVR4) | |
| # define GTEST_OS_SOLARIS 1 | | # define GTEST_OS_SOLARIS 1 | |
| #elif defined(_AIX) | | #elif defined(_AIX) | |
| # define GTEST_OS_AIX 1 | | # define GTEST_OS_AIX 1 | |
| #elif defined(__hpux) | | #elif defined(__hpux) | |
| # define GTEST_OS_HPUX 1 | | # define GTEST_OS_HPUX 1 | |
| #elif defined __native_client__ | | #elif defined __native_client__ | |
| # define GTEST_OS_NACL 1 | | # define GTEST_OS_NACL 1 | |
|
| | | #elif defined __OpenBSD__ | |
| | | # define GTEST_OS_OPENBSD 1 | |
| | | #elif defined __QNX__ | |
| | | # define GTEST_OS_QNX 1 | |
| #endif // __CYGWIN__ | | #endif // __CYGWIN__ | |
| | | | |
|
| | | #ifndef GTEST_LANG_CXX11 | |
| | | // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when | |
| | | // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a | |
| | | // value for __cplusplus, and recent versions of clang, gcc, and | |
| | | // probably other compilers set that too in C++11 mode. | |
| | | # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L | |
| | | // Compiling in at least C++11 mode. | |
| | | # define GTEST_LANG_CXX11 1 | |
| | | # else | |
| | | # define GTEST_LANG_CXX11 0 | |
| | | # endif | |
| | | #endif | |
| | | | |
| // Brings in definitions for functions used in the testing::internal::posix | | // Brings in definitions for functions used in the testing::internal::posix | |
| // namespace (read, write, close, chdir, isatty, stat). We do not currently | | // namespace (read, write, close, chdir, isatty, stat). We do not currently | |
| // use them on Windows Mobile. | | // use them on Windows Mobile. | |
| #if !GTEST_OS_WINDOWS | | #if !GTEST_OS_WINDOWS | |
| // This assumes that non-Windows OSes provide unistd.h. For OSes where this | | // This assumes that non-Windows OSes provide unistd.h. For OSes where this | |
| // is not the case, we need to include headers that provide the functions | | // is not the case, we need to include headers that provide the functions | |
| // mentioned above. | | // mentioned above. | |
| # include <unistd.h> | | # include <unistd.h> | |
|
| # if !GTEST_OS_NACL | | # include <strings.h> | |
| // TODO(vladl@google.com): Remove this condition when Native Client SDK add | | | |
| s | | | |
| // strings.h (tracked in | | | |
| // http://code.google.com/p/nativeclient/issues/detail?id=1175). | | | |
| # include <strings.h> // Native Client doesn't provide strings.h. | | | |
| # endif | | | |
| #elif !GTEST_OS_WINDOWS_MOBILE | | #elif !GTEST_OS_WINDOWS_MOBILE | |
| # include <direct.h> | | # include <direct.h> | |
| # include <io.h> | | # include <io.h> | |
| #endif | | #endif | |
| | | | |
|
| | | #if GTEST_OS_LINUX_ANDROID | |
| | | // Used to define __ANDROID_API__ matching the target NDK API level. | |
| | | # include <android/api-level.h> // NOLINT | |
| | | #endif | |
| | | | |
| // Defines this to true iff Google Test can use POSIX regular expressions. | | // Defines this to true iff Google Test can use POSIX regular expressions. | |
| #ifndef GTEST_HAS_POSIX_RE | | #ifndef GTEST_HAS_POSIX_RE | |
|
| # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) | | # if GTEST_OS_LINUX_ANDROID | |
| | | // On Android, <regex.h> is only available starting with Gingerbread. | |
| | | # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9) | |
| | | # else | |
| | | # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) | |
| | | # endif | |
| #endif | | #endif | |
| | | | |
| #if GTEST_HAS_POSIX_RE | | #if GTEST_HAS_POSIX_RE | |
| | | | |
| // On some platforms, <regex.h> needs someone to define size_t, and | | // On some platforms, <regex.h> needs someone to define size_t, and | |
| // won't compile otherwise. We can #include it here as we already | | // won't compile otherwise. We can #include it here as we already | |
| // included <stdlib.h>, which is guaranteed to define size_t through | | // included <stdlib.h>, which is guaranteed to define size_t through | |
| // <stddef.h>. | | // <stddef.h>. | |
| # include <regex.h> // NOLINT | | # include <regex.h> // NOLINT | |
| | | | |
| | | | |
| skipping to change at line 383 | | skipping to change at line 426 | |
| # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. | | # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. | |
| # define GTEST_HAS_RTTI 1 | | # define GTEST_HAS_RTTI 1 | |
| # else | | # else | |
| # define GTEST_HAS_RTTI 0 | | # define GTEST_HAS_RTTI 0 | |
| # endif | | # endif | |
| | | | |
| // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. | | // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. | |
| # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) | | # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) | |
| | | | |
| # ifdef __GXX_RTTI | | # ifdef __GXX_RTTI | |
|
| # define GTEST_HAS_RTTI 1 | | // When building against STLport with the Android NDK and with | |
| | | // -frtti -fno-exceptions, the build fails at link time with undefined | |
| | | // references to __cxa_bad_typeid. Note sure if STL or toolchain bug, | |
| | | // so disable RTTI when detected. | |
| | | # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \ | |
| | | !defined(__EXCEPTIONS) | |
| | | # define GTEST_HAS_RTTI 0 | |
| | | # else | |
| | | # define GTEST_HAS_RTTI 1 | |
| | | # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS | |
| # else | | # else | |
| # define GTEST_HAS_RTTI 0 | | # define GTEST_HAS_RTTI 0 | |
| # endif // __GXX_RTTI | | # endif // __GXX_RTTI | |
| | | | |
|
| | | // Clang defines __GXX_RTTI starting with version 3.0, but its manual recom | |
| | | mends | |
| | | // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, | |
| | | the | |
| | | // first version with C++ support. | |
| | | # elif defined(__clang__) | |
| | | | |
| | | # define GTEST_HAS_RTTI __has_feature(cxx_rtti) | |
| | | | |
| // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if | | // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if | |
| // both the typeid and dynamic_cast features are present. | | // both the typeid and dynamic_cast features are present. | |
| # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) | | # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) | |
| | | | |
| # ifdef __RTTI_ALL__ | | # ifdef __RTTI_ALL__ | |
| # define GTEST_HAS_RTTI 1 | | # define GTEST_HAS_RTTI 1 | |
| # else | | # else | |
| # define GTEST_HAS_RTTI 0 | | # define GTEST_HAS_RTTI 0 | |
| # endif | | # endif | |
| | | | |
| | | | |
| skipping to change at line 420 | | skipping to change at line 479 | |
| # include <typeinfo> | | # include <typeinfo> | |
| #endif | | #endif | |
| | | | |
| // Determines whether Google Test can use the pthreads library. | | // Determines whether Google Test can use the pthreads library. | |
| #ifndef GTEST_HAS_PTHREAD | | #ifndef GTEST_HAS_PTHREAD | |
| // The user didn't tell us explicitly, so we assume pthreads support is | | // The user didn't tell us explicitly, so we assume pthreads support is | |
| // available on Linux and Mac. | | // available on Linux and Mac. | |
| // | | // | |
| // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 | | // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 | |
| // to your compiler flags. | | // to your compiler flags. | |
|
| # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX | | # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX | |
| ) | | \ | |
| | | || GTEST_OS_QNX) | |
| #endif // GTEST_HAS_PTHREAD | | #endif // GTEST_HAS_PTHREAD | |
| | | | |
| #if GTEST_HAS_PTHREAD | | #if GTEST_HAS_PTHREAD | |
| // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD i
s | | // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD i
s | |
| // true. | | // true. | |
| # include <pthread.h> // NOLINT | | # include <pthread.h> // NOLINT | |
| | | | |
| // For timespec and nanosleep, used below. | | // For timespec and nanosleep, used below. | |
| # include <time.h> // NOLINT | | # include <time.h> // NOLINT | |
| #endif | | #endif | |
| | | | |
| // Determines whether Google Test can use tr1/tuple. You can define | | // Determines whether Google Test can use tr1/tuple. You can define | |
| // this macro to 0 to prevent Google Test from using tuple (any | | // this macro to 0 to prevent Google Test from using tuple (any | |
| // feature depending on tuple with be disabled in this mode). | | // feature depending on tuple with be disabled in this mode). | |
| #ifndef GTEST_HAS_TR1_TUPLE | | #ifndef GTEST_HAS_TR1_TUPLE | |
|
| | | # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) | |
| | | // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tupl | |
| | | e>. | |
| | | # define GTEST_HAS_TR1_TUPLE 0 | |
| | | # else | |
| // The user didn't tell us not to do it, so we assume it's OK. | | // The user didn't tell us not to do it, so we assume it's OK. | |
|
| # define GTEST_HAS_TR1_TUPLE 1 | | # define GTEST_HAS_TR1_TUPLE 1 | |
| | | # endif | |
| #endif // GTEST_HAS_TR1_TUPLE | | #endif // GTEST_HAS_TR1_TUPLE | |
| | | | |
| // Determines whether Google Test's own tr1 tuple implementation | | // Determines whether Google Test's own tr1 tuple implementation | |
| // should be used. | | // should be used. | |
| #ifndef GTEST_USE_OWN_TR1_TUPLE | | #ifndef GTEST_USE_OWN_TR1_TUPLE | |
| // The user didn't tell us, so we need to figure it out. | | // The user didn't tell us, so we need to figure it out. | |
| | | | |
| // We use our own TR1 tuple if we aren't sure the user has an | | // We use our own TR1 tuple if we aren't sure the user has an | |
|
| // implementation of it already. At this time, GCC 4.0.0+ and MSVC | | // implementation of it already. At this time, libstdc++ 4.0.0+ and | |
| // 2010 are the only mainstream compilers that come with a TR1 tuple | | // MSVC 2010 are the only mainstream standard libraries that come | |
| // implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by | | // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler | |
| // defining __GNUC__ and friends, but cannot compile GCC's tuple | | // pretends to be GCC by defining __GNUC__ and friends, but cannot | |
| // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB | | // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1 | |
| // Feature Pack download, which we cannot assume the user has. | | // tuple in a 323 MB Feature Pack download, which we cannot assume the | |
| # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000 | | // user has. QNX's QCC compiler is a modified GCC but it doesn't | |
| )) \ | | // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode, | |
| || _MSC_VER >= 1600 | | // and it can be used with some compilers that define __GNUC__. | |
| | | # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000 | |
| | | ) \ | |
| | | && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600 | |
| | | # define GTEST_ENV_HAS_TR1_TUPLE_ 1 | |
| | | # endif | |
| | | | |
| | | // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is u | |
| | | sed | |
| | | // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 | |
| | | // can build with clang but need to use gcc4.2's libstdc++). | |
| | | # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) | |
| | | # define GTEST_ENV_HAS_STD_TUPLE_ 1 | |
| | | # endif | |
| | | | |
| | | # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ | |
| # define GTEST_USE_OWN_TR1_TUPLE 0 | | # define GTEST_USE_OWN_TR1_TUPLE 0 | |
| # else | | # else | |
| # define GTEST_USE_OWN_TR1_TUPLE 1 | | # define GTEST_USE_OWN_TR1_TUPLE 1 | |
| # endif | | # endif | |
| | | | |
| #endif // GTEST_USE_OWN_TR1_TUPLE | | #endif // GTEST_USE_OWN_TR1_TUPLE | |
| | | | |
| // To avoid conditional compilation everywhere, we make it | | // To avoid conditional compilation everywhere, we make it | |
| // gtest-port.h's responsibility to #include the header implementing | | // gtest-port.h's responsibility to #include the header implementing | |
| // tr1/tuple. | | // tr1/tuple. | |
| #if GTEST_HAS_TR1_TUPLE | | #if GTEST_HAS_TR1_TUPLE | |
| | | | |
| # if GTEST_USE_OWN_TR1_TUPLE | | # if GTEST_USE_OWN_TR1_TUPLE | |
| # include "gtest/internal/gtest-tuple.h" | | # include "gtest/internal/gtest-tuple.h" | |
|
| | | # elif GTEST_ENV_HAS_STD_TUPLE_ | |
| | | # include <tuple> | |
| | | // C++11 puts its tuple into the ::std namespace rather than | |
| | | // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. | |
| | | // This causes undefined behavior, but supported compilers react in | |
| | | // the way we intend. | |
| | | namespace std { | |
| | | namespace tr1 { | |
| | | using ::std::get; | |
| | | using ::std::make_tuple; | |
| | | using ::std::tuple; | |
| | | using ::std::tuple_element; | |
| | | using ::std::tuple_size; | |
| | | } | |
| | | } | |
| | | | |
| # elif GTEST_OS_SYMBIAN | | # elif GTEST_OS_SYMBIAN | |
| | | | |
| // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to | | // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to | |
| // use STLport's tuple implementation, which unfortunately doesn't | | // use STLport's tuple implementation, which unfortunately doesn't | |
| // work as the copy of STLport distributed with Symbian is incomplete. | | // work as the copy of STLport distributed with Symbian is incomplete. | |
| // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to | | // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to | |
| // use its own tuple implementation. | | // use its own tuple implementation. | |
| # ifdef BOOST_HAS_TR1_TUPLE | | # ifdef BOOST_HAS_TR1_TUPLE | |
| # undef BOOST_HAS_TR1_TUPLE | | # undef BOOST_HAS_TR1_TUPLE | |
| # endif // BOOST_HAS_TR1_TUPLE | | # endif // BOOST_HAS_TR1_TUPLE | |
| | | | |
| skipping to change at line 518 | | skipping to change at line 613 | |
| #endif // GTEST_HAS_TR1_TUPLE | | #endif // GTEST_HAS_TR1_TUPLE | |
| | | | |
| // Determines whether clone(2) is supported. | | // Determines whether clone(2) is supported. | |
| // Usually it will only be available on Linux, excluding | | // Usually it will only be available on Linux, excluding | |
| // Linux on the Itanium architecture. | | // Linux on the Itanium architecture. | |
| // Also see http://linux.die.net/man/2/clone. | | // Also see http://linux.die.net/man/2/clone. | |
| #ifndef GTEST_HAS_CLONE | | #ifndef GTEST_HAS_CLONE | |
| // The user didn't tell us, so we need to figure it out. | | // The user didn't tell us, so we need to figure it out. | |
| | | | |
| # if GTEST_OS_LINUX && !defined(__ia64__) | | # if GTEST_OS_LINUX && !defined(__ia64__) | |
|
| # define GTEST_HAS_CLONE 1 | | # if GTEST_OS_LINUX_ANDROID | |
| | | // On Android, clone() is only available on ARM starting with Gingerbread. | |
| | | # if defined(__arm__) && __ANDROID_API__ >= 9 | |
| | | # define GTEST_HAS_CLONE 1 | |
| | | # else | |
| | | # define GTEST_HAS_CLONE 0 | |
| | | # endif | |
| | | # else | |
| | | # define GTEST_HAS_CLONE 1 | |
| | | # endif | |
| # else | | # else | |
| # define GTEST_HAS_CLONE 0 | | # define GTEST_HAS_CLONE 0 | |
| # endif // GTEST_OS_LINUX && !defined(__ia64__) | | # endif // GTEST_OS_LINUX && !defined(__ia64__) | |
| | | | |
| #endif // GTEST_HAS_CLONE | | #endif // GTEST_HAS_CLONE | |
| | | | |
| // Determines whether to support stream redirection. This is used to test | | // Determines whether to support stream redirection. This is used to test | |
| // output correctness and to implement death tests. | | // output correctness and to implement death tests. | |
| #ifndef GTEST_HAS_STREAM_REDIRECTION | | #ifndef GTEST_HAS_STREAM_REDIRECTION | |
| // By default, we assume that stream redirection is supported on all | | // By default, we assume that stream redirection is supported on all | |
| | | | |
| skipping to change at line 541 | | skipping to change at line 645 | |
| # define GTEST_HAS_STREAM_REDIRECTION 0 | | # define GTEST_HAS_STREAM_REDIRECTION 0 | |
| # else | | # else | |
| # define GTEST_HAS_STREAM_REDIRECTION 1 | | # define GTEST_HAS_STREAM_REDIRECTION 1 | |
| # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN | | # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN | |
| #endif // GTEST_HAS_STREAM_REDIRECTION | | #endif // GTEST_HAS_STREAM_REDIRECTION | |
| | | | |
| // Determines whether to support death tests. | | // Determines whether to support death tests. | |
| // Google Test does not support death tests for VC 7.1 and earlier as | | // Google Test does not support death tests for VC 7.1 and earlier as | |
| // abort() in a VC 7.1 application compiled as GUI in debug config | | // abort() in a VC 7.1 application compiled as GUI in debug config | |
| // pops up a dialog window that cannot be suppressed programmatically. | | // pops up a dialog window that cannot be suppressed programmatically. | |
|
| #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS | | #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ | |
| || \ | | (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \ | |
| (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ | | (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ | |
|
| GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX) | | GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ | |
| | | GTEST_OS_OPENBSD || GTEST_OS_QNX) | |
| # define GTEST_HAS_DEATH_TEST 1 | | # define GTEST_HAS_DEATH_TEST 1 | |
| # include <vector> // NOLINT | | # include <vector> // NOLINT | |
| #endif | | #endif | |
| | | | |
| // We don't support MSVC 7.1 with exceptions disabled now. Therefore | | // We don't support MSVC 7.1 with exceptions disabled now. Therefore | |
| // all the compilers we care about are adequate for supporting | | // all the compilers we care about are adequate for supporting | |
| // value-parameterized tests. | | // value-parameterized tests. | |
| #define GTEST_HAS_PARAM_TEST 1 | | #define GTEST_HAS_PARAM_TEST 1 | |
| | | | |
| // Determines whether to support type-driven tests. | | // Determines whether to support type-driven tests. | |
| | | | |
| skipping to change at line 672 | | skipping to change at line 778 | |
| # define GTEST_API_ | | # define GTEST_API_ | |
| #endif | | #endif | |
| | | | |
| #ifdef __GNUC__ | | #ifdef __GNUC__ | |
| // Ask the compiler to never inline a given function. | | // Ask the compiler to never inline a given function. | |
| # define GTEST_NO_INLINE_ __attribute__((noinline)) | | # define GTEST_NO_INLINE_ __attribute__((noinline)) | |
| #else | | #else | |
| # define GTEST_NO_INLINE_ | | # define GTEST_NO_INLINE_ | |
| #endif | | #endif | |
| | | | |
|
| | | // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project. | |
| | | #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) | |
| | | # define GTEST_HAS_CXXABI_H_ 1 | |
| | | #else | |
| | | # define GTEST_HAS_CXXABI_H_ 0 | |
| | | #endif | |
| | | | |
| namespace testing { | | namespace testing { | |
| | | | |
| class Message; | | class Message; | |
| | | | |
| namespace internal { | | namespace internal { | |
| | | | |
|
| class String; | | // A secret type that Google Test users don't know about. It has no | |
| | | // definition on purpose. Therefore it's impossible to create a | |
| | | // Secret object, which is what we want. | |
| | | class Secret; | |
| | | | |
| // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile tim
e | | // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile tim
e | |
| // expression is true. For example, you could use it to verify the | | // expression is true. For example, you could use it to verify the | |
| // size of a static array: | | // size of a static array: | |
| // | | // | |
| // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYP
ES, | | // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYP
ES, | |
| // content_type_names_incorrect_size); | | // content_type_names_incorrect_size); | |
| // | | // | |
| // or to make sure a struct is smaller than a certain size: | | // or to make sure a struct is smaller than a certain size: | |
| // | | // | |
| | | | |
| skipping to change at line 700 | | skipping to change at line 816 | |
| // | | // | |
| // The second argument to the macro is the name of the variable. If | | // The second argument to the macro is the name of the variable. If | |
| // the expression is false, most compilers will issue a warning/error | | // the expression is false, most compilers will issue a warning/error | |
| // containing the name of the variable. | | // containing the name of the variable. | |
| | | | |
| template <bool> | | template <bool> | |
| struct CompileAssert { | | struct CompileAssert { | |
| }; | | }; | |
| | | | |
| #define GTEST_COMPILE_ASSERT_(expr, msg) \ | | #define GTEST_COMPILE_ASSERT_(expr, msg) \ | |
|
| typedef ::testing::internal::CompileAssert<(bool(expr))> \ | | typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \ | |
| msg[bool(expr) ? 1 : -1] | | msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_ | |
| | | | |
| // Implementation details of GTEST_COMPILE_ASSERT_: | | // Implementation details of GTEST_COMPILE_ASSERT_: | |
| // | | // | |
| // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 | | // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 | |
| // elements (and thus is invalid) when the expression is false. | | // elements (and thus is invalid) when the expression is false. | |
| // | | // | |
| // - The simpler definition | | // - The simpler definition | |
| // | | // | |
| // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1
: -1] | | // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1
: -1] | |
| // | | // | |
| | | | |
| skipping to change at line 799 | | skipping to change at line 915 | |
| } | | } | |
| | | | |
| void reset(T* p = NULL) { | | void reset(T* p = NULL) { | |
| if (p != ptr_) { | | if (p != ptr_) { | |
| if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. | | if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. | |
| delete ptr_; | | delete ptr_; | |
| } | | } | |
| ptr_ = p; | | ptr_ = p; | |
| } | | } | |
| } | | } | |
|
| | | | |
| private: | | private: | |
| T* ptr_; | | T* ptr_; | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); | |
| }; | | }; | |
| | | | |
| // Defines RE. | | // Defines RE. | |
| | | | |
| // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended | | // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended | |
| // Regular Expression syntax. | | // Regular Expression syntax. | |
| | | | |
| skipping to change at line 861 | | skipping to change at line 978 | |
| } | | } | |
| | | | |
| #endif // GTEST_HAS_GLOBAL_STRING | | #endif // GTEST_HAS_GLOBAL_STRING | |
| | | | |
| static bool FullMatch(const char* str, const RE& re); | | static bool FullMatch(const char* str, const RE& re); | |
| static bool PartialMatch(const char* str, const RE& re); | | static bool PartialMatch(const char* str, const RE& re); | |
| | | | |
| private: | | private: | |
| void Init(const char* regex); | | void Init(const char* regex); | |
| | | | |
|
| // We use a const char* instead of a string, as Google Test may be used | | // We use a const char* instead of an std::string, as Google Test used to | |
| // where string is not available. We also do not use Google Test's own | | be | |
| // String type here, in order to simplify dependencies between the | | // used where std::string is not available. TODO(wan@google.com): change | |
| // files. | | to | |
| | | // std::string. | |
| const char* pattern_; | | const char* pattern_; | |
| bool is_valid_; | | bool is_valid_; | |
| | | | |
| #if GTEST_USES_POSIX_RE | | #if GTEST_USES_POSIX_RE | |
| | | | |
| regex_t full_regex_; // For FullMatch(). | | regex_t full_regex_; // For FullMatch(). | |
| regex_t partial_regex_; // For PartialMatch(). | | regex_t partial_regex_; // For PartialMatch(). | |
| | | | |
| #else // GTEST_USES_SIMPLE_RE | | #else // GTEST_USES_SIMPLE_RE | |
| | | | |
| | | | |
| skipping to change at line 1047 | | skipping to change at line 1163 | |
| | | | |
| #if GTEST_HAS_STREAM_REDIRECTION | | #if GTEST_HAS_STREAM_REDIRECTION | |
| | | | |
| // Defines the stderr capturer: | | // Defines the stderr capturer: | |
| // CaptureStdout - starts capturing stdout. | | // CaptureStdout - starts capturing stdout. | |
| // GetCapturedStdout - stops capturing stdout and returns the captured st
ring. | | // GetCapturedStdout - stops capturing stdout and returns the captured st
ring. | |
| // CaptureStderr - starts capturing stderr. | | // CaptureStderr - starts capturing stderr. | |
| // GetCapturedStderr - stops capturing stderr and returns the captured st
ring. | | // GetCapturedStderr - stops capturing stderr and returns the captured st
ring. | |
| // | | // | |
| GTEST_API_ void CaptureStdout(); | | GTEST_API_ void CaptureStdout(); | |
|
| GTEST_API_ String GetCapturedStdout(); | | GTEST_API_ std::string GetCapturedStdout(); | |
| GTEST_API_ void CaptureStderr(); | | GTEST_API_ void CaptureStderr(); | |
|
| GTEST_API_ String GetCapturedStderr(); | | GTEST_API_ std::string GetCapturedStderr(); | |
| | | | |
| #endif // GTEST_HAS_STREAM_REDIRECTION | | #endif // GTEST_HAS_STREAM_REDIRECTION | |
| | | | |
| #if GTEST_HAS_DEATH_TEST | | #if GTEST_HAS_DEATH_TEST | |
| | | | |
|
| // A copy of all command line arguments. Set by InitGoogleTest(). | | const ::std::vector<testing::internal::string>& GetInjectableArgvs(); | |
| extern ::std::vector<String> g_argvs; | | void SetInjectableArgvs(const ::std::vector<testing::internal::string>* | |
| | | new_argvs); | |
| | | | |
|
| // GTEST_HAS_DEATH_TEST implies we have ::std::string. | | // A copy of all command line arguments. Set by InitGoogleTest(). | |
| const ::std::vector<String>& GetArgvs(); | | extern ::std::vector<testing::internal::string> g_argvs; | |
| | | | |
| #endif // GTEST_HAS_DEATH_TEST | | #endif // GTEST_HAS_DEATH_TEST | |
| | | | |
| // Defines synchronization primitives. | | // Defines synchronization primitives. | |
| | | | |
| #if GTEST_HAS_PTHREAD | | #if GTEST_HAS_PTHREAD | |
| | | | |
| // Sleeps for (roughly) n milli-seconds. This function is only for | | // Sleeps for (roughly) n milli-seconds. This function is only for | |
| // testing Google Test's own constructs. Don't use it in user tests, | | // testing Google Test's own constructs. Don't use it in user tests, | |
| // either directly or indirectly. | | // either directly or indirectly. | |
| | | | |
| skipping to change at line 1086 | | skipping to change at line 1203 | |
| } | | } | |
| | | | |
| // Allows a controller thread to pause execution of newly created | | // Allows a controller thread to pause execution of newly created | |
| // threads until notified. Instances of this class must be created | | // threads until notified. Instances of this class must be created | |
| // and destroyed in the controller thread. | | // and destroyed in the controller thread. | |
| // | | // | |
| // This class is only for testing Google Test's own constructs. Do not | | // This class is only for testing Google Test's own constructs. Do not | |
| // use it in user tests, either directly or indirectly. | | // use it in user tests, either directly or indirectly. | |
| class Notification { | | class Notification { | |
| public: | | public: | |
|
| Notification() : notified_(false) {} | | Notification() : notified_(false) { | |
| | | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); | |
| | | } | |
| | | ~Notification() { | |
| | | pthread_mutex_destroy(&mutex_); | |
| | | } | |
| | | | |
| // Notifies all threads created with this notification to start. Must | | // Notifies all threads created with this notification to start. Must | |
| // be called from the controller thread. | | // be called from the controller thread. | |
|
| void Notify() { notified_ = true; } | | void Notify() { | |
| | | pthread_mutex_lock(&mutex_); | |
| | | notified_ = true; | |
| | | pthread_mutex_unlock(&mutex_); | |
| | | } | |
| | | | |
| // Blocks until the controller thread notifies. Must be called from a tes
t | | // Blocks until the controller thread notifies. Must be called from a tes
t | |
| // thread. | | // thread. | |
| void WaitForNotification() { | | void WaitForNotification() { | |
|
| while(!notified_) { | | for (;;) { | |
| | | pthread_mutex_lock(&mutex_); | |
| | | const bool notified = notified_; | |
| | | pthread_mutex_unlock(&mutex_); | |
| | | if (notified) | |
| | | break; | |
| SleepMilliseconds(10); | | SleepMilliseconds(10); | |
| } | | } | |
| } | | } | |
| | | | |
| private: | | private: | |
|
| volatile bool notified_; | | pthread_mutex_t mutex_; | |
| | | bool notified_; | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); | |
| }; | | }; | |
| | | | |
| // As a C-function, ThreadFuncWithCLinkage cannot be templated itself. | | // As a C-function, ThreadFuncWithCLinkage cannot be templated itself. | |
| // Consequently, it cannot select a correct instantiation of ThreadWithPara
m | | // Consequently, it cannot select a correct instantiation of ThreadWithPara
m | |
| // in order to call its Run(). Introducing ThreadWithParamBase as a | | // in order to call its Run(). Introducing ThreadWithParamBase as a | |
| // non-templated base class for ThreadWithParam allows us to bypass this | | // non-templated base class for ThreadWithParam allows us to bypass this | |
| // problem. | | // problem. | |
| class ThreadWithParamBase { | | class ThreadWithParamBase { | |
| | | | |
| skipping to change at line 1209 | | skipping to change at line 1341 | |
| // | | // | |
| // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); | | // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); | |
| // | | // | |
| // To create a dynamic mutex, just define an object of type Mutex. | | // To create a dynamic mutex, just define an object of type Mutex. | |
| class MutexBase { | | class MutexBase { | |
| public: | | public: | |
| // Acquires this mutex. | | // Acquires this mutex. | |
| void Lock() { | | void Lock() { | |
| GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); | | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); | |
| owner_ = pthread_self(); | | owner_ = pthread_self(); | |
|
| | | has_owner_ = true; | |
| } | | } | |
| | | | |
| // Releases this mutex. | | // Releases this mutex. | |
| void Unlock() { | | void Unlock() { | |
|
| // We don't protect writing to owner_ here, as it's the caller's | | // Since the lock is being released the owner_ field should no longer b | |
| // responsibility to ensure that the current thread holds the | | e | |
| | | // considered valid. We don't protect writing to has_owner_ here, as it | |
| | | 's | |
| | | // the caller's responsibility to ensure that the current thread holds | |
| | | the | |
| // mutex when this is called. | | // mutex when this is called. | |
|
| owner_ = 0; | | has_owner_ = false; | |
| GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); | | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); | |
| } | | } | |
| | | | |
| // Does nothing if the current thread holds the mutex. Otherwise, crashes | | // Does nothing if the current thread holds the mutex. Otherwise, crashes | |
| // with high probability. | | // with high probability. | |
| void AssertHeld() const { | | void AssertHeld() const { | |
|
| GTEST_CHECK_(owner_ == pthread_self()) | | GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) | |
| << "The current thread is not holding the mutex @" << this; | | << "The current thread is not holding the mutex @" << this; | |
| } | | } | |
| | | | |
| // A static mutex may be used before main() is entered. It may even | | // A static mutex may be used before main() is entered. It may even | |
| // be used before the dynamic initialization stage. Therefore we | | // be used before the dynamic initialization stage. Therefore we | |
| // must be able to initialize a static mutex object at link time. | | // must be able to initialize a static mutex object at link time. | |
| // This means MutexBase has to be a POD and its member variables | | // This means MutexBase has to be a POD and its member variables | |
| // have to be public. | | // have to be public. | |
| public: | | public: | |
| pthread_mutex_t mutex_; // The underlying pthread mutex. | | pthread_mutex_t mutex_; // The underlying pthread mutex. | |
|
| pthread_t owner_; // The thread holding the mutex; 0 means no one holds | | // has_owner_ indicates whether the owner_ field below contains a valid t | |
| it. | | hread | |
| | | // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). | |
| | | All | |
| | | // accesses to the owner_ field should be protected by a check of this fi | |
| | | eld. | |
| | | // An alternative might be to memset() owner_ to all zeros, but there's n | |
| | | o | |
| | | // guarantee that a zero'd pthread_t is necessarily invalid or even diffe | |
| | | rent | |
| | | // from pthread_self(). | |
| | | bool has_owner_; | |
| | | pthread_t owner_; // The thread holding the mutex. | |
| }; | | }; | |
| | | | |
| // Forward-declares a static mutex. | | // Forward-declares a static mutex. | |
| # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ | | # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ | |
| extern ::testing::internal::MutexBase mutex | | extern ::testing::internal::MutexBase mutex | |
| | | | |
| // Defines and statically (i.e. at link time) initializes a static mutex. | | // Defines and statically (i.e. at link time) initializes a static mutex. | |
|
| | | // The initialization list here does not explicitly initialize each field, | |
| | | // instead relying on default initialization for the unspecified fields. In | |
| | | // particular, the owner_ field (a pthread_t) is not explicitly initialized | |
| | | . | |
| | | // This allows initialization to work whether pthread_t is a scalar or stru | |
| | | ct. | |
| | | // The flag -Wmissing-field-initializers must not be specified for this to | |
| | | work. | |
| # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ | | # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ | |
|
| ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 } | | ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, fal
se } | |
| | | | |
| // The Mutex class can only be used for mutexes created at runtime. It | | // The Mutex class can only be used for mutexes created at runtime. It | |
| // shares its API with MutexBase otherwise. | | // shares its API with MutexBase otherwise. | |
| class Mutex : public MutexBase { | | class Mutex : public MutexBase { | |
| public: | | public: | |
| Mutex() { | | Mutex() { | |
| GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); | | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); | |
|
| owner_ = 0; | | has_owner_ = false; | |
| } | | } | |
| ~Mutex() { | | ~Mutex() { | |
| GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); | | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); | |
| } | | } | |
| | | | |
| private: | | private: | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); | |
| }; | | }; | |
| | | | |
| // We cannot name this class MutexLock as the ctor declaration would | | // We cannot name this class MutexLock as the ctor declaration would | |
| | | | |
| skipping to change at line 1401 | | skipping to change at line 1547 | |
| #else // GTEST_HAS_PTHREAD | | #else // GTEST_HAS_PTHREAD | |
| | | | |
| // A dummy implementation of synchronization primitives (mutex, lock, | | // A dummy implementation of synchronization primitives (mutex, lock, | |
| // and thread-local variable). Necessary for compiling Google Test where | | // and thread-local variable). Necessary for compiling Google Test where | |
| // mutex is not supported - using Google Test in multiple threads is not | | // mutex is not supported - using Google Test in multiple threads is not | |
| // supported on such platforms. | | // supported on such platforms. | |
| | | | |
| class Mutex { | | class Mutex { | |
| public: | | public: | |
| Mutex() {} | | Mutex() {} | |
|
| | | void Lock() {} | |
| | | void Unlock() {} | |
| void AssertHeld() const {} | | void AssertHeld() const {} | |
| }; | | }; | |
| | | | |
| # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ | | # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ | |
| extern ::testing::internal::Mutex mutex | | extern ::testing::internal::Mutex mutex | |
| | | | |
| # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex | | # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex | |
| | | | |
| class GTestMutexLock { | | class GTestMutexLock { | |
| public: | | public: | |
| | | | |
| skipping to change at line 1531 | | skipping to change at line 1679 | |
| } | | } | |
| inline bool IsSpace(char ch) { | | inline bool IsSpace(char ch) { | |
| return isspace(static_cast<unsigned char>(ch)) != 0; | | return isspace(static_cast<unsigned char>(ch)) != 0; | |
| } | | } | |
| inline bool IsUpper(char ch) { | | inline bool IsUpper(char ch) { | |
| return isupper(static_cast<unsigned char>(ch)) != 0; | | return isupper(static_cast<unsigned char>(ch)) != 0; | |
| } | | } | |
| inline bool IsXDigit(char ch) { | | inline bool IsXDigit(char ch) { | |
| return isxdigit(static_cast<unsigned char>(ch)) != 0; | | return isxdigit(static_cast<unsigned char>(ch)) != 0; | |
| } | | } | |
|
| | | inline bool IsXDigit(wchar_t ch) { | |
| | | const unsigned char low_byte = static_cast<unsigned char>(ch); | |
| | | return ch == low_byte && isxdigit(low_byte) != 0; | |
| | | } | |
| | | | |
| inline char ToLower(char ch) { | | inline char ToLower(char ch) { | |
| return static_cast<char>(tolower(static_cast<unsigned char>(ch))); | | return static_cast<char>(tolower(static_cast<unsigned char>(ch))); | |
| } | | } | |
| inline char ToUpper(char ch) { | | inline char ToUpper(char ch) { | |
| return static_cast<char>(toupper(static_cast<unsigned char>(ch))); | | return static_cast<char>(toupper(static_cast<unsigned char>(ch))); | |
| } | | } | |
| | | | |
| // The testing::internal::posix namespace holds wrappers for common | | // The testing::internal::posix namespace holds wrappers for common | |
| // POSIX functions. These wrappers hide the differences between | | // POSIX functions. These wrappers hide the differences between | |
| | | | |
| skipping to change at line 1668 | | skipping to change at line 1820 | |
| // Windows CE has no C library. The abort() function is used in | | // Windows CE has no C library. The abort() function is used in | |
| // several places in Google Test. This implementation provides a reasonable | | // several places in Google Test. This implementation provides a reasonable | |
| // imitation of standard behaviour. | | // imitation of standard behaviour. | |
| void Abort(); | | void Abort(); | |
| #else | | #else | |
| inline void Abort() { abort(); } | | inline void Abort() { abort(); } | |
| #endif // GTEST_OS_WINDOWS_MOBILE | | #endif // GTEST_OS_WINDOWS_MOBILE | |
| | | | |
| } // namespace posix | | } // namespace posix | |
| | | | |
|
| | | // MSVC "deprecates" snprintf and issues warnings wherever it is used. In | |
| | | // order to avoid these warnings, we need to use _snprintf or _snprintf_s o | |
| | | n | |
| | | // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropria | |
| | | te | |
| | | // function in order to achieve that. We use macro definition here because | |
| | | // snprintf is a variadic function. | |
| | | #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE | |
| | | // MSVC 2005 and above support variadic macros. | |
| | | # define GTEST_SNPRINTF_(buffer, size, format, ...) \ | |
| | | _snprintf_s(buffer, size, size, format, __VA_ARGS__) | |
| | | #elif defined(_MSC_VER) | |
| | | // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't | |
| | | // complain about _snprintf. | |
| | | # define GTEST_SNPRINTF_ _snprintf | |
| | | #else | |
| | | # define GTEST_SNPRINTF_ snprintf | |
| | | #endif | |
| | | | |
| // The maximum number a BiggestInt can represent. This definition | | // The maximum number a BiggestInt can represent. This definition | |
| // works no matter BiggestInt is represented in one's complement or | | // works no matter BiggestInt is represented in one's complement or | |
| // two's complement. | | // two's complement. | |
| // | | // | |
| // We cannot rely on numeric_limits in STL, as __int64 and long long | | // We cannot rely on numeric_limits in STL, as __int64 and long long | |
| // are not part of standard C++ and numeric_limits doesn't need to be | | // are not part of standard C++ and numeric_limits doesn't need to be | |
| // defined for them. | | // defined for them. | |
| const BiggestInt kMaxBiggestInt = | | const BiggestInt kMaxBiggestInt = | |
| ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1)); | | ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1)); | |
| | | | |
| | | | |
| skipping to change at line 1720 | | skipping to change at line 1889 | |
| // As base/basictypes.h doesn't compile on Windows, we cannot use | | // As base/basictypes.h doesn't compile on Windows, we cannot use | |
| // uint32, uint64, and etc here. | | // uint32, uint64, and etc here. | |
| typedef int Int; | | typedef int Int; | |
| typedef unsigned int UInt; | | typedef unsigned int UInt; | |
| }; | | }; | |
| | | | |
| // The specialization for size 8. | | // The specialization for size 8. | |
| template <> | | template <> | |
| class TypeWithSize<8> { | | class TypeWithSize<8> { | |
| public: | | public: | |
|
| | | | |
| #if GTEST_OS_WINDOWS | | #if GTEST_OS_WINDOWS | |
| typedef __int64 Int; | | typedef __int64 Int; | |
| typedef unsigned __int64 UInt; | | typedef unsigned __int64 UInt; | |
| #else | | #else | |
| typedef long long Int; // NOLINT | | typedef long long Int; // NOLINT | |
| typedef unsigned long long UInt; // NOLINT | | typedef unsigned long long UInt; // NOLINT | |
| #endif // GTEST_OS_WINDOWS | | #endif // GTEST_OS_WINDOWS | |
| }; | | }; | |
| | | | |
| // Integer types of known sizes. | | // Integer types of known sizes. | |
| | | | |
| skipping to change at line 1747 | | skipping to change at line 1915 | |
| // Utilities for command line flags and environment variables. | | // Utilities for command line flags and environment variables. | |
| | | | |
| // Macro for referencing flags. | | // Macro for referencing flags. | |
| #define GTEST_FLAG(name) FLAGS_gtest_##name | | #define GTEST_FLAG(name) FLAGS_gtest_##name | |
| | | | |
| // Macros for declaring flags. | | // Macros for declaring flags. | |
| #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) | | #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) | |
| #define GTEST_DECLARE_int32_(name) \ | | #define GTEST_DECLARE_int32_(name) \ | |
| GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) | | GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) | |
| #define GTEST_DECLARE_string_(name) \ | | #define GTEST_DECLARE_string_(name) \ | |
|
| GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name) | | GTEST_API_ extern ::std::string GTEST_FLAG(name) | |
| | | | |
| // Macros for defining flags. | | // Macros for defining flags. | |
| #define GTEST_DEFINE_bool_(name, default_val, doc) \ | | #define GTEST_DEFINE_bool_(name, default_val, doc) \ | |
| GTEST_API_ bool GTEST_FLAG(name) = (default_val) | | GTEST_API_ bool GTEST_FLAG(name) = (default_val) | |
| #define GTEST_DEFINE_int32_(name, default_val, doc) \ | | #define GTEST_DEFINE_int32_(name, default_val, doc) \ | |
| GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) | | GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) | |
| #define GTEST_DEFINE_string_(name, default_val, doc) \ | | #define GTEST_DEFINE_string_(name, default_val, doc) \ | |
|
| GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val) | | GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) | |
| | | | |
| | | // Thread annotations | |
| | | #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) | |
| | | #define GTEST_LOCK_EXCLUDED_(locks) | |
| | | | |
| // Parses 'str' for a 32-bit signed integer. If successful, writes the res
ult | | // Parses 'str' for a 32-bit signed integer. If successful, writes the res
ult | |
| // to *value and returns true; otherwise leaves *value unchanged and return
s | | // to *value and returns true; otherwise leaves *value unchanged and return
s | |
| // false. | | // false. | |
| // TODO(chandlerc): Find a better way to refactor flag and environment pars
ing | | // TODO(chandlerc): Find a better way to refactor flag and environment pars
ing | |
| // out of both gtest-port.cc and gtest.cc to avoid exporting this utility | | // out of both gtest-port.cc and gtest.cc to avoid exporting this utility | |
| // function. | | // function. | |
| bool ParseInt32(const Message& src_text, const char* str, Int32* value); | | bool ParseInt32(const Message& src_text, const char* str, Int32* value); | |
| | | | |
| // Parses a bool/Int32/string from the environment variable | | // Parses a bool/Int32/string from the environment variable | |
| | | | |
End of changes. 51 change blocks. |
| 56 lines changed or deleted | | 245 lines changed or added | |
|
| gtest.h | | gtest.h | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 55 | |
| // program! | | // program! | |
| // | | // | |
| // Acknowledgment: Google Test borrowed the idea of automatic test | | // Acknowledgment: Google Test borrowed the idea of automatic test | |
| // registration from Barthelemy Dagenais' (barthelemy@prologique.com) | | // registration from Barthelemy Dagenais' (barthelemy@prologique.com) | |
| // easyUnit framework. | | // easyUnit framework. | |
| | | | |
| #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ | | #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ | |
| #define GTEST_INCLUDE_GTEST_GTEST_H_ | | #define GTEST_INCLUDE_GTEST_GTEST_H_ | |
| | | | |
| #include <limits> | | #include <limits> | |
|
| | | #include <ostream> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include "gtest/internal/gtest-internal.h" | | #include "gtest/internal/gtest-internal.h" | |
| #include "gtest/internal/gtest-string.h" | | #include "gtest/internal/gtest-string.h" | |
| #include "gtest/gtest-death-test.h" | | #include "gtest/gtest-death-test.h" | |
| #include "gtest/gtest-message.h" | | #include "gtest/gtest-message.h" | |
| #include "gtest/gtest-param-test.h" | | #include "gtest/gtest-param-test.h" | |
| #include "gtest/gtest-printers.h" | | #include "gtest/gtest-printers.h" | |
| #include "gtest/gtest_prod.h" | | #include "gtest/gtest_prod.h" | |
| #include "gtest/gtest-test-part.h" | | #include "gtest/gtest-test-part.h" | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 157 | |
| const int kMaxStackTraceDepth = 100; | | const int kMaxStackTraceDepth = 100; | |
| | | | |
| namespace internal { | | namespace internal { | |
| | | | |
| class AssertHelper; | | class AssertHelper; | |
| class DefaultGlobalTestPartResultReporter; | | class DefaultGlobalTestPartResultReporter; | |
| class ExecDeathTest; | | class ExecDeathTest; | |
| class NoExecDeathTest; | | class NoExecDeathTest; | |
| class FinalSuccessChecker; | | class FinalSuccessChecker; | |
| class GTestFlagSaver; | | class GTestFlagSaver; | |
|
| | | class StreamingListenerTest; | |
| class TestResultAccessor; | | class TestResultAccessor; | |
| class TestEventListenersAccessor; | | class TestEventListenersAccessor; | |
| class TestEventRepeater; | | class TestEventRepeater; | |
|
| | | class UnitTestRecordPropertyTestHelper; | |
| class WindowsDeathTest; | | class WindowsDeathTest; | |
| class UnitTestImpl* GetUnitTestImpl(); | | class UnitTestImpl* GetUnitTestImpl(); | |
| void ReportFailureInUnknownLocation(TestPartResult::Type result_type, | | void ReportFailureInUnknownLocation(TestPartResult::Type result_type, | |
|
| const String& message); | | const std::string& message); | |
| | | | |
| // Converts a streamable value to a String. A NULL pointer is | | | |
| // converted to "(null)". When the input value is a ::string, | | | |
| // ::std::string, ::wstring, or ::std::wstring object, each NUL | | | |
| // character in it is replaced with "\\0". | | | |
| // Declared in gtest-internal.h but defined here, so that it has access | | | |
| // to the definition of the Message class, required by the ARM | | | |
| // compiler. | | | |
| template <typename T> | | | |
| String StreamableToString(const T& streamable) { | | | |
| return (Message() << streamable).GetString(); | | | |
| } | | | |
| | | | |
| } // namespace internal | | } // namespace internal | |
| | | | |
| // The friend relationship of some of these classes is cyclic. | | // The friend relationship of some of these classes is cyclic. | |
| // If we don't forward declare them the compiler might confuse the classes | | // If we don't forward declare them the compiler might confuse the classes | |
| // in friendship clauses with same named classes on the scope. | | // in friendship clauses with same named classes on the scope. | |
| class Test; | | class Test; | |
| class TestCase; | | class TestCase; | |
| class TestInfo; | | class TestInfo; | |
| class UnitTest; | | class UnitTest; | |
| | | | |
| skipping to change at line 394 | | skipping to change at line 385 | |
| // Returns true iff the current test has a fatal failure. | | // Returns true iff the current test has a fatal failure. | |
| static bool HasFatalFailure(); | | static bool HasFatalFailure(); | |
| | | | |
| // Returns true iff the current test has a non-fatal failure. | | // Returns true iff the current test has a non-fatal failure. | |
| static bool HasNonfatalFailure(); | | static bool HasNonfatalFailure(); | |
| | | | |
| // Returns true iff the current test has a (either fatal or | | // Returns true iff the current test has a (either fatal or | |
| // non-fatal) failure. | | // non-fatal) failure. | |
| static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure
(); } | | static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure
(); } | |
| | | | |
|
| // Logs a property for the current test. Only the last value for a given | | // Logs a property for the current test, test case, or for the entire | |
| // key is remembered. | | // invocation of the test program when used outside of the context of a | |
| // These are public static so they can be called from utility functions | | // test case. Only the last value for a given key is remembered. These | |
| // that are not members of the test fixture. | | // are public static so they can be called from utility functions that ar | |
| // The arguments are const char* instead strings, as Google Test is used | | e | |
| // on platforms where string doesn't compile. | | // not members of the test fixture. Calls to RecordProperty made during | |
| // | | // lifespan of the test (from the moment its constructor starts to the | |
| // Note that a driving consideration for these RecordProperty methods | | // moment its destructor finishes) will be output in XML as attributes of | |
| // was to produce xml output suited to the Greenspan charting utility, | | // the <testcase> element. Properties recorded from fixture's | |
| // which at present will only chart values that fit in a 32-bit int. It | | // SetUpTestCase or TearDownTestCase are logged as attributes of the | |
| // is the user's responsibility to restrict their values to 32-bit ints | | // corresponding <testsuite> element. Calls to RecordProperty made in th | |
| // if they intend them to be used with Greenspan. | | e | |
| static void RecordProperty(const char* key, const char* value); | | // global context (before or after invocation of RUN_ALL_TESTS and from | |
| static void RecordProperty(const char* key, int value); | | // SetUp/TearDown method of Environment objects registered with Google | |
| | | // Test) will be output as attributes of the <testsuites> element. | |
| | | static void RecordProperty(const std::string& key, const std::string& val | |
| | | ue); | |
| | | static void RecordProperty(const std::string& key, int value); | |
| | | | |
| protected: | | protected: | |
| // Creates a Test object. | | // Creates a Test object. | |
| Test(); | | Test(); | |
| | | | |
| // Sets up the test fixture. | | // Sets up the test fixture. | |
| virtual void SetUp(); | | virtual void SetUp(); | |
| | | | |
| // Tears down the test fixture. | | // Tears down the test fixture. | |
| virtual void TearDown(); | | virtual void TearDown(); | |
| | | | |
| skipping to change at line 476 | | skipping to change at line 468 | |
| | | | |
| // A copyable object representing a user specified test property which can
be | | // A copyable object representing a user specified test property which can
be | |
| // output as a key/value string pair. | | // output as a key/value string pair. | |
| // | | // | |
| // Don't inherit from TestProperty as its destructor is not virtual. | | // Don't inherit from TestProperty as its destructor is not virtual. | |
| class TestProperty { | | class TestProperty { | |
| public: | | public: | |
| // C'tor. TestProperty does NOT have a default constructor. | | // C'tor. TestProperty does NOT have a default constructor. | |
| // Always use this constructor (with parameters) to create a | | // Always use this constructor (with parameters) to create a | |
| // TestProperty object. | | // TestProperty object. | |
|
| TestProperty(const char* a_key, const char* a_value) : | | TestProperty(const std::string& a_key, const std::string& a_value) : | |
| key_(a_key), value_(a_value) { | | key_(a_key), value_(a_value) { | |
| } | | } | |
| | | | |
| // Gets the user supplied key. | | // Gets the user supplied key. | |
| const char* key() const { | | const char* key() const { | |
| return key_.c_str(); | | return key_.c_str(); | |
| } | | } | |
| | | | |
| // Gets the user supplied value. | | // Gets the user supplied value. | |
| const char* value() const { | | const char* value() const { | |
| return value_.c_str(); | | return value_.c_str(); | |
| } | | } | |
| | | | |
| // Sets a new value, overriding the one supplied in the constructor. | | // Sets a new value, overriding the one supplied in the constructor. | |
|
| void SetValue(const char* new_value) { | | void SetValue(const std::string& new_value) { | |
| value_ = new_value; | | value_ = new_value; | |
| } | | } | |
| | | | |
| private: | | private: | |
| // The key supplied by the user. | | // The key supplied by the user. | |
|
| internal::String key_; | | std::string key_; | |
| // The value supplied by the user. | | // The value supplied by the user. | |
|
| internal::String value_; | | std::string value_; | |
| }; | | }; | |
| | | | |
| // The result of a single Test. This includes a list of | | // The result of a single Test. This includes a list of | |
| // TestPartResults, a list of TestProperties, a count of how many | | // TestPartResults, a list of TestProperties, a count of how many | |
| // death tests there are in the Test, and how much time it took to run | | // death tests there are in the Test, and how much time it took to run | |
| // the Test. | | // the Test. | |
| // | | // | |
| // TestResult is not copyable. | | // TestResult is not copyable. | |
| class GTEST_API_ TestResult { | | class GTEST_API_ TestResult { | |
| public: | | public: | |
| | | | |
| skipping to change at line 550 | | skipping to change at line 542 | |
| // the program. | | // the program. | |
| const TestPartResult& GetTestPartResult(int i) const; | | const TestPartResult& GetTestPartResult(int i) const; | |
| | | | |
| // Returns the i-th test property. i can range from 0 to | | // Returns the i-th test property. i can range from 0 to | |
| // test_property_count() - 1. If i is not in that range, aborts the | | // test_property_count() - 1. If i is not in that range, aborts the | |
| // program. | | // program. | |
| const TestProperty& GetTestProperty(int i) const; | | const TestProperty& GetTestProperty(int i) const; | |
| | | | |
| private: | | private: | |
| friend class TestInfo; | | friend class TestInfo; | |
|
| | | friend class TestCase; | |
| friend class UnitTest; | | friend class UnitTest; | |
| friend class internal::DefaultGlobalTestPartResultReporter; | | friend class internal::DefaultGlobalTestPartResultReporter; | |
| friend class internal::ExecDeathTest; | | friend class internal::ExecDeathTest; | |
| friend class internal::TestResultAccessor; | | friend class internal::TestResultAccessor; | |
| friend class internal::UnitTestImpl; | | friend class internal::UnitTestImpl; | |
| friend class internal::WindowsDeathTest; | | friend class internal::WindowsDeathTest; | |
| | | | |
| // Gets the vector of TestPartResults. | | // Gets the vector of TestPartResults. | |
| const std::vector<TestPartResult>& test_part_results() const { | | const std::vector<TestPartResult>& test_part_results() const { | |
| return test_part_results_; | | return test_part_results_; | |
| | | | |
| skipping to change at line 574 | | skipping to change at line 567 | |
| return test_properties_; | | return test_properties_; | |
| } | | } | |
| | | | |
| // Sets the elapsed time. | | // Sets the elapsed time. | |
| void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } | | void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } | |
| | | | |
| // Adds a test property to the list. The property is validated and may ad
d | | // Adds a test property to the list. The property is validated and may ad
d | |
| // a non-fatal failure if invalid (e.g., if it conflicts with reserved | | // a non-fatal failure if invalid (e.g., if it conflicts with reserved | |
| // key names). If a property is already recorded for the same key, the | | // key names). If a property is already recorded for the same key, the | |
| // value will be updated, rather than storing multiple values for the sam
e | | // value will be updated, rather than storing multiple values for the sam
e | |
|
| // key. | | // key. xml_element specifies the element for which the property is bein | |
| void RecordProperty(const TestProperty& test_property); | | g | |
| | | // recorded and is used for validation. | |
| | | void RecordProperty(const std::string& xml_element, | |
| | | const TestProperty& test_property); | |
| | | | |
| // Adds a failure if the key is a reserved attribute of Google Test | | // Adds a failure if the key is a reserved attribute of Google Test | |
| // testcase tags. Returns true if the property is valid. | | // testcase tags. Returns true if the property is valid. | |
| // TODO(russr): Validate attribute names are legal and human readable. | | // TODO(russr): Validate attribute names are legal and human readable. | |
|
| static bool ValidateTestProperty(const TestProperty& test_property); | | static bool ValidateTestProperty(const std::string& xml_element, | |
| | | const TestProperty& test_property); | |
| | | | |
| // Adds a test part result to the list. | | // Adds a test part result to the list. | |
| void AddTestPartResult(const TestPartResult& test_part_result); | | void AddTestPartResult(const TestPartResult& test_part_result); | |
| | | | |
| // Returns the death test count. | | // Returns the death test count. | |
| int death_test_count() const { return death_test_count_; } | | int death_test_count() const { return death_test_count_; } | |
| | | | |
| // Increments the death test count, returning the new count. | | // Increments the death test count, returning the new count. | |
| int increment_death_test_count() { return ++death_test_count_; } | | int increment_death_test_count() { return ++death_test_count_; } | |
| | | | |
| | | | |
| skipping to change at line 653 | | skipping to change at line 649 | |
| } | | } | |
| | | | |
| // Returns the text representation of the value parameter, or NULL if thi
s | | // Returns the text representation of the value parameter, or NULL if thi
s | |
| // is not a value-parameterized test. | | // is not a value-parameterized test. | |
| const char* value_param() const { | | const char* value_param() const { | |
| if (value_param_.get() != NULL) | | if (value_param_.get() != NULL) | |
| return value_param_->c_str(); | | return value_param_->c_str(); | |
| return NULL; | | return NULL; | |
| } | | } | |
| | | | |
|
| // Returns true if this test should run, that is if the test is not disab | | // Returns true if this test should run, that is if the test is not | |
| led | | // disabled (or it is disabled but the also_run_disabled_tests flag has | |
| // (or it is disabled but the also_run_disabled_tests flag has been speci | | // been specified) and its full name matches the user-specified filter. | |
| fied) | | | |
| // and its full name matches the user-specified filter. | | | |
| // | | // | |
| // Google Test allows the user to filter the tests by their full names. | | // Google Test allows the user to filter the tests by their full names. | |
| // The full name of a test Bar in test case Foo is defined as | | // The full name of a test Bar in test case Foo is defined as | |
| // "Foo.Bar". Only the tests that match the filter will run. | | // "Foo.Bar". Only the tests that match the filter will run. | |
| // | | // | |
| // A filter is a colon-separated list of glob (not regex) patterns, | | // A filter is a colon-separated list of glob (not regex) patterns, | |
| // optionally followed by a '-' and a colon-separated list of | | // optionally followed by a '-' and a colon-separated list of | |
| // negative patterns (tests to exclude). A test is run if it | | // negative patterns (tests to exclude). A test is run if it | |
| // matches one of the positive patterns and does not match any of | | // matches one of the positive patterns and does not match any of | |
| // the negative patterns. | | // the negative patterns. | |
| // | | // | |
| // For example, *A*:Foo.* is a filter that matches any string that | | // For example, *A*:Foo.* is a filter that matches any string that | |
| // contains the character 'A' or starts with "Foo.". | | // contains the character 'A' or starts with "Foo.". | |
| bool should_run() const { return should_run_; } | | bool should_run() const { return should_run_; } | |
| | | | |
|
| | | // Returns true iff this test will appear in the XML report. | |
| | | bool is_reportable() const { | |
| | | // For now, the XML report includes all tests matching the filter. | |
| | | // In the future, we may trim tests that are excluded because of | |
| | | // sharding. | |
| | | return matches_filter_; | |
| | | } | |
| | | | |
| // Returns the result of the test. | | // Returns the result of the test. | |
| const TestResult* result() const { return &result_; } | | const TestResult* result() const { return &result_; } | |
| | | | |
| private: | | private: | |
|
| | | | |
| #if GTEST_HAS_DEATH_TEST | | #if GTEST_HAS_DEATH_TEST | |
| friend class internal::DefaultDeathTestFactory; | | friend class internal::DefaultDeathTestFactory; | |
| #endif // GTEST_HAS_DEATH_TEST | | #endif // GTEST_HAS_DEATH_TEST | |
| friend class Test; | | friend class Test; | |
| friend class TestCase; | | friend class TestCase; | |
| friend class internal::UnitTestImpl; | | friend class internal::UnitTestImpl; | |
|
| | | friend class internal::StreamingListenerTest; | |
| friend TestInfo* internal::MakeAndRegisterTestInfo( | | friend TestInfo* internal::MakeAndRegisterTestInfo( | |
|
| const char* test_case_name, const char* name, | | const char* test_case_name, | |
| | | const char* name, | |
| const char* type_param, | | const char* type_param, | |
| const char* value_param, | | const char* value_param, | |
| internal::TypeId fixture_class_id, | | internal::TypeId fixture_class_id, | |
| Test::SetUpTestCaseFunc set_up_tc, | | Test::SetUpTestCaseFunc set_up_tc, | |
| Test::TearDownTestCaseFunc tear_down_tc, | | Test::TearDownTestCaseFunc tear_down_tc, | |
| internal::TestFactoryBase* factory); | | internal::TestFactoryBase* factory); | |
| | | | |
| // Constructs a TestInfo object. The newly constructed instance assumes | | // Constructs a TestInfo object. The newly constructed instance assumes | |
| // ownership of the factory object. | | // ownership of the factory object. | |
|
| TestInfo(const char* test_case_name, const char* name, | | TestInfo(const std::string& test_case_name, | |
| const char* a_type_param, | | const std::string& name, | |
| const char* a_value_param, | | const char* a_type_param, // NULL if not a type-parameterized | |
| | | test | |
| | | const char* a_value_param, // NULL if not a value-parameterized | |
| | | test | |
| internal::TypeId fixture_class_id, | | internal::TypeId fixture_class_id, | |
| internal::TestFactoryBase* factory); | | internal::TestFactoryBase* factory); | |
| | | | |
| // Increments the number of death tests encountered in this test so | | // Increments the number of death tests encountered in this test so | |
| // far. | | // far. | |
| int increment_death_test_count() { | | int increment_death_test_count() { | |
| return result_.increment_death_test_count(); | | return result_.increment_death_test_count(); | |
| } | | } | |
| | | | |
| // Creates the test object, runs it, records its result, and then | | // Creates the test object, runs it, records its result, and then | |
| | | | |
| skipping to change at line 781 | | skipping to change at line 787 | |
| | | | |
| // Returns true if any test in this test case should run. | | // Returns true if any test in this test case should run. | |
| bool should_run() const { return should_run_; } | | bool should_run() const { return should_run_; } | |
| | | | |
| // Gets the number of successful tests in this test case. | | // Gets the number of successful tests in this test case. | |
| int successful_test_count() const; | | int successful_test_count() const; | |
| | | | |
| // Gets the number of failed tests in this test case. | | // Gets the number of failed tests in this test case. | |
| int failed_test_count() const; | | int failed_test_count() const; | |
| | | | |
|
| | | // Gets the number of disabled tests that will be reported in the XML rep | |
| | | ort. | |
| | | int reportable_disabled_test_count() const; | |
| | | | |
| // Gets the number of disabled tests in this test case. | | // Gets the number of disabled tests in this test case. | |
| int disabled_test_count() const; | | int disabled_test_count() const; | |
| | | | |
|
| | | // Gets the number of tests to be printed in the XML report. | |
| | | int reportable_test_count() const; | |
| | | | |
| // Get the number of tests in this test case that should run. | | // Get the number of tests in this test case that should run. | |
| int test_to_run_count() const; | | int test_to_run_count() const; | |
| | | | |
| // Gets the number of all tests in this test case. | | // Gets the number of all tests in this test case. | |
| int total_test_count() const; | | int total_test_count() const; | |
| | | | |
| // Returns true iff the test case passed. | | // Returns true iff the test case passed. | |
| bool Passed() const { return !Failed(); } | | bool Passed() const { return !Failed(); } | |
| | | | |
| // Returns true iff the test case failed. | | // Returns true iff the test case failed. | |
| bool Failed() const { return failed_test_count() > 0; } | | bool Failed() const { return failed_test_count() > 0; } | |
| | | | |
| // Returns the elapsed time, in milliseconds. | | // Returns the elapsed time, in milliseconds. | |
| TimeInMillis elapsed_time() const { return elapsed_time_; } | | TimeInMillis elapsed_time() const { return elapsed_time_; } | |
| | | | |
| // Returns the i-th test among all the tests. i can range from 0 to | | // Returns the i-th test among all the tests. i can range from 0 to | |
| // total_test_count() - 1. If i is not in that range, returns NULL. | | // total_test_count() - 1. If i is not in that range, returns NULL. | |
| const TestInfo* GetTestInfo(int i) const; | | const TestInfo* GetTestInfo(int i) const; | |
| | | | |
|
| | | // Returns the TestResult that holds test properties recorded during | |
| | | // execution of SetUpTestCase and TearDownTestCase. | |
| | | const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_ | |
| | | ; } | |
| | | | |
| private: | | private: | |
| friend class Test; | | friend class Test; | |
| friend class internal::UnitTestImpl; | | friend class internal::UnitTestImpl; | |
| | | | |
| // Gets the (mutable) vector of TestInfos in this TestCase. | | // Gets the (mutable) vector of TestInfos in this TestCase. | |
| std::vector<TestInfo*>& test_info_list() { return test_info_list_; } | | std::vector<TestInfo*>& test_info_list() { return test_info_list_; } | |
| | | | |
| // Gets the (immutable) vector of TestInfos in this TestCase. | | // Gets the (immutable) vector of TestInfos in this TestCase. | |
| const std::vector<TestInfo*>& test_info_list() const { | | const std::vector<TestInfo*>& test_info_list() const { | |
| return test_info_list_; | | return test_info_list_; | |
| | | | |
| skipping to change at line 855 | | skipping to change at line 871 | |
| // Returns true iff test passed. | | // Returns true iff test passed. | |
| static bool TestPassed(const TestInfo* test_info) { | | static bool TestPassed(const TestInfo* test_info) { | |
| return test_info->should_run() && test_info->result()->Passed(); | | return test_info->should_run() && test_info->result()->Passed(); | |
| } | | } | |
| | | | |
| // Returns true iff test failed. | | // Returns true iff test failed. | |
| static bool TestFailed(const TestInfo* test_info) { | | static bool TestFailed(const TestInfo* test_info) { | |
| return test_info->should_run() && test_info->result()->Failed(); | | return test_info->should_run() && test_info->result()->Failed(); | |
| } | | } | |
| | | | |
|
| | | // Returns true iff the test is disabled and will be reported in the XML | |
| | | // report. | |
| | | static bool TestReportableDisabled(const TestInfo* test_info) { | |
| | | return test_info->is_reportable() && test_info->is_disabled_; | |
| | | } | |
| | | | |
| // Returns true iff test is disabled. | | // Returns true iff test is disabled. | |
| static bool TestDisabled(const TestInfo* test_info) { | | static bool TestDisabled(const TestInfo* test_info) { | |
| return test_info->is_disabled_; | | return test_info->is_disabled_; | |
| } | | } | |
| | | | |
|
| | | // Returns true iff this test will appear in the XML report. | |
| | | static bool TestReportable(const TestInfo* test_info) { | |
| | | return test_info->is_reportable(); | |
| | | } | |
| | | | |
| // Returns true if the given test should run. | | // Returns true if the given test should run. | |
| static bool ShouldRunTest(const TestInfo* test_info) { | | static bool ShouldRunTest(const TestInfo* test_info) { | |
| return test_info->should_run(); | | return test_info->should_run(); | |
| } | | } | |
| | | | |
| // Shuffles the tests in this test case. | | // Shuffles the tests in this test case. | |
| void ShuffleTests(internal::Random* random); | | void ShuffleTests(internal::Random* random); | |
| | | | |
| // Restores the test order to before the first shuffle. | | // Restores the test order to before the first shuffle. | |
| void UnshuffleTests(); | | void UnshuffleTests(); | |
| | | | |
| // Name of the test case. | | // Name of the test case. | |
|
| internal::String name_; | | std::string name_; | |
| // Name of the parameter type, or NULL if this is not a typed or a | | // Name of the parameter type, or NULL if this is not a typed or a | |
| // type-parameterized test. | | // type-parameterized test. | |
| const internal::scoped_ptr<const ::std::string> type_param_; | | const internal::scoped_ptr<const ::std::string> type_param_; | |
| // The vector of TestInfos in their original order. It owns the | | // The vector of TestInfos in their original order. It owns the | |
| // elements in the vector. | | // elements in the vector. | |
| std::vector<TestInfo*> test_info_list_; | | std::vector<TestInfo*> test_info_list_; | |
| // Provides a level of indirection for the test list to allow easy | | // Provides a level of indirection for the test list to allow easy | |
| // shuffling and restoring the test order. The i-th element in this | | // shuffling and restoring the test order. The i-th element in this | |
| // vector is the index of the i-th test in the shuffled test list. | | // vector is the index of the i-th test in the shuffled test list. | |
| std::vector<int> test_indices_; | | std::vector<int> test_indices_; | |
| // Pointer to the function that sets up the test case. | | // Pointer to the function that sets up the test case. | |
| Test::SetUpTestCaseFunc set_up_tc_; | | Test::SetUpTestCaseFunc set_up_tc_; | |
| // Pointer to the function that tears down the test case. | | // Pointer to the function that tears down the test case. | |
| Test::TearDownTestCaseFunc tear_down_tc_; | | Test::TearDownTestCaseFunc tear_down_tc_; | |
| // True iff any test in this test case should run. | | // True iff any test in this test case should run. | |
| bool should_run_; | | bool should_run_; | |
| // Elapsed time, in milliseconds. | | // Elapsed time, in milliseconds. | |
| TimeInMillis elapsed_time_; | | TimeInMillis elapsed_time_; | |
|
| | | // Holds test properties recorded during execution of SetUpTestCase and | |
| | | // TearDownTestCase. | |
| | | TestResult ad_hoc_test_result_; | |
| | | | |
| // We disallow copying TestCases. | | // We disallow copying TestCases. | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); | |
| }; | | }; | |
| | | | |
| // An Environment object is capable of setting up and tearing down an | | // An Environment object is capable of setting up and tearing down an | |
| // environment. The user should subclass this to define his own | | // environment. The user should subclass this to define his own | |
| // environment(s). | | // environment(s). | |
| // | | // | |
| // An Environment object does the set-up and tear-down in virtual | | // An Environment object does the set-up and tear-down in virtual | |
| | | | |
| skipping to change at line 1110 | | skipping to change at line 1140 | |
| // | | // | |
| // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
| int Run() GTEST_MUST_USE_RESULT_; | | int Run() GTEST_MUST_USE_RESULT_; | |
| | | | |
| // Returns the working directory when the first TEST() or TEST_F() | | // Returns the working directory when the first TEST() or TEST_F() | |
| // was executed. The UnitTest object owns the string. | | // was executed. The UnitTest object owns the string. | |
| const char* original_working_dir() const; | | const char* original_working_dir() const; | |
| | | | |
| // Returns the TestCase object for the test that's currently running, | | // Returns the TestCase object for the test that's currently running, | |
| // or NULL if no test is running. | | // or NULL if no test is running. | |
|
| const TestCase* current_test_case() const; | | const TestCase* current_test_case() const | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| | | | |
| // Returns the TestInfo object for the test that's currently running, | | // Returns the TestInfo object for the test that's currently running, | |
| // or NULL if no test is running. | | // or NULL if no test is running. | |
|
| const TestInfo* current_test_info() const; | | const TestInfo* current_test_info() const | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| | | | |
| // Returns the random seed used at the start of the current test run. | | // Returns the random seed used at the start of the current test run. | |
| int random_seed() const; | | int random_seed() const; | |
| | | | |
| #if GTEST_HAS_PARAM_TEST | | #if GTEST_HAS_PARAM_TEST | |
| // Returns the ParameterizedTestCaseRegistry object used to keep track of | | // Returns the ParameterizedTestCaseRegistry object used to keep track of | |
| // value-parameterized tests and instantiate and register them. | | // value-parameterized tests and instantiate and register them. | |
| // | | // | |
| // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
|
| internal::ParameterizedTestCaseRegistry& parameterized_test_registry(); | | internal::ParameterizedTestCaseRegistry& parameterized_test_registry() | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| #endif // GTEST_HAS_PARAM_TEST | | #endif // GTEST_HAS_PARAM_TEST | |
| | | | |
| // Gets the number of successful test cases. | | // Gets the number of successful test cases. | |
| int successful_test_case_count() const; | | int successful_test_case_count() const; | |
| | | | |
| // Gets the number of failed test cases. | | // Gets the number of failed test cases. | |
| int failed_test_case_count() const; | | int failed_test_case_count() const; | |
| | | | |
| // Gets the number of all test cases. | | // Gets the number of all test cases. | |
| int total_test_case_count() const; | | int total_test_case_count() const; | |
| | | | |
| skipping to change at line 1146 | | skipping to change at line 1179 | |
| // Gets the number of all test cases that contain at least one test | | // Gets the number of all test cases that contain at least one test | |
| // that should run. | | // that should run. | |
| int test_case_to_run_count() const; | | int test_case_to_run_count() const; | |
| | | | |
| // Gets the number of successful tests. | | // Gets the number of successful tests. | |
| int successful_test_count() const; | | int successful_test_count() const; | |
| | | | |
| // Gets the number of failed tests. | | // Gets the number of failed tests. | |
| int failed_test_count() const; | | int failed_test_count() const; | |
| | | | |
|
| | | // Gets the number of disabled tests that will be reported in the XML rep | |
| | | ort. | |
| | | int reportable_disabled_test_count() const; | |
| | | | |
| // Gets the number of disabled tests. | | // Gets the number of disabled tests. | |
| int disabled_test_count() const; | | int disabled_test_count() const; | |
| | | | |
|
| | | // Gets the number of tests to be printed in the XML report. | |
| | | int reportable_test_count() const; | |
| | | | |
| // Gets the number of all tests. | | // Gets the number of all tests. | |
| int total_test_count() const; | | int total_test_count() const; | |
| | | | |
| // Gets the number of tests that should run. | | // Gets the number of tests that should run. | |
| int test_to_run_count() const; | | int test_to_run_count() const; | |
| | | | |
|
| | | // Gets the time of the test program start, in ms from the start of the | |
| | | // UNIX epoch. | |
| | | TimeInMillis start_timestamp() const; | |
| | | | |
| // Gets the elapsed time, in milliseconds. | | // Gets the elapsed time, in milliseconds. | |
| TimeInMillis elapsed_time() const; | | TimeInMillis elapsed_time() const; | |
| | | | |
| // Returns true iff the unit test passed (i.e. all test cases passed). | | // Returns true iff the unit test passed (i.e. all test cases passed). | |
| bool Passed() const; | | bool Passed() const; | |
| | | | |
| // Returns true iff the unit test failed (i.e. some test case failed | | // Returns true iff the unit test failed (i.e. some test case failed | |
| // or something outside of all tests failed). | | // or something outside of all tests failed). | |
| bool Failed() const; | | bool Failed() const; | |
| | | | |
| // Gets the i-th test case among all the test cases. i can range from 0 t
o | | // Gets the i-th test case among all the test cases. i can range from 0 t
o | |
| // total_test_case_count() - 1. If i is not in that range, returns NULL. | | // total_test_case_count() - 1. If i is not in that range, returns NULL. | |
| const TestCase* GetTestCase(int i) const; | | const TestCase* GetTestCase(int i) const; | |
| | | | |
|
| | | // Returns the TestResult containing information on test failures and | |
| | | // properties logged outside of individual test cases. | |
| | | const TestResult& ad_hoc_test_result() const; | |
| | | | |
| // Returns the list of event listeners that can be used to track events | | // Returns the list of event listeners that can be used to track events | |
| // inside Google Test. | | // inside Google Test. | |
| TestEventListeners& listeners(); | | TestEventListeners& listeners(); | |
| | | | |
| private: | | private: | |
| // Registers and returns a global test environment. When a test | | // Registers and returns a global test environment. When a test | |
| // program is run, all global test environments will be set-up in | | // program is run, all global test environments will be set-up in | |
| // the order they were registered. After all tests in the program | | // the order they were registered. After all tests in the program | |
| // have finished, all global test environments will be torn-down in | | // have finished, all global test environments will be torn-down in | |
| // the *reverse* order they were registered. | | // the *reverse* order they were registered. | |
| | | | |
| skipping to change at line 1192 | | skipping to change at line 1239 | |
| // This method can only be called from the main thread. | | // This method can only be called from the main thread. | |
| Environment* AddEnvironment(Environment* env); | | Environment* AddEnvironment(Environment* env); | |
| | | | |
| // Adds a TestPartResult to the current TestResult object. All | | // Adds a TestPartResult to the current TestResult object. All | |
| // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) | | // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) | |
| // eventually call this to report their results. The user code | | // eventually call this to report their results. The user code | |
| // should use the assertion macros instead of calling this directly. | | // should use the assertion macros instead of calling this directly. | |
| void AddTestPartResult(TestPartResult::Type result_type, | | void AddTestPartResult(TestPartResult::Type result_type, | |
| const char* file_name, | | const char* file_name, | |
| int line_number, | | int line_number, | |
|
| const internal::String& message, | | const std::string& message, | |
| const internal::String& os_stack_trace); | | const std::string& os_stack_trace) | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| // Adds a TestProperty to the current TestResult object. If the result al | | | |
| ready | | // Adds a TestProperty to the current TestResult object when invoked from | |
| // contains a property with the same key, the value will be updated. | | // inside a test, to current TestCase's ad_hoc_test_result_ when invoked | |
| void RecordPropertyForCurrentTest(const char* key, const char* value); | | // from SetUpTestCase or TearDownTestCase, or to the global property set | |
| | | // when invoked elsewhere. If the result already contains a property wit | |
| | | h | |
| | | // the same key, the value will be updated. | |
| | | void RecordProperty(const std::string& key, const std::string& value); | |
| | | | |
| // Gets the i-th test case among all the test cases. i can range from 0 t
o | | // Gets the i-th test case among all the test cases. i can range from 0 t
o | |
| // total_test_case_count() - 1. If i is not in that range, returns NULL. | | // total_test_case_count() - 1. If i is not in that range, returns NULL. | |
| TestCase* GetMutableTestCase(int i); | | TestCase* GetMutableTestCase(int i); | |
| | | | |
| // Accessors for the implementation object. | | // Accessors for the implementation object. | |
| internal::UnitTestImpl* impl() { return impl_; } | | internal::UnitTestImpl* impl() { return impl_; } | |
| const internal::UnitTestImpl* impl() const { return impl_; } | | const internal::UnitTestImpl* impl() const { return impl_; } | |
| | | | |
| // These classes and funcions are friends as they need to access private | | // These classes and funcions are friends as they need to access private | |
| // members of UnitTest. | | // members of UnitTest. | |
| friend class Test; | | friend class Test; | |
| friend class internal::AssertHelper; | | friend class internal::AssertHelper; | |
| friend class internal::ScopedTrace; | | friend class internal::ScopedTrace; | |
|
| | | friend class internal::StreamingListenerTest; | |
| | | friend class internal::UnitTestRecordPropertyTestHelper; | |
| friend Environment* AddGlobalTestEnvironment(Environment* env); | | friend Environment* AddGlobalTestEnvironment(Environment* env); | |
| friend internal::UnitTestImpl* internal::GetUnitTestImpl(); | | friend internal::UnitTestImpl* internal::GetUnitTestImpl(); | |
| friend void internal::ReportFailureInUnknownLocation( | | friend void internal::ReportFailureInUnknownLocation( | |
| TestPartResult::Type result_type, | | TestPartResult::Type result_type, | |
|
| const internal::String& message); | | const std::string& message); | |
| | | | |
| // Creates an empty UnitTest. | | // Creates an empty UnitTest. | |
| UnitTest(); | | UnitTest(); | |
| | | | |
| // D'tor | | // D'tor | |
| virtual ~UnitTest(); | | virtual ~UnitTest(); | |
| | | | |
| // Pushes a trace defined by SCOPED_TRACE() on to the per-thread | | // Pushes a trace defined by SCOPED_TRACE() on to the per-thread | |
| // Google Test trace stack. | | // Google Test trace stack. | |
|
| void PushGTestTrace(const internal::TraceInfo& trace); | | void PushGTestTrace(const internal::TraceInfo& trace) | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| | | | |
| // Pops a trace from the per-thread Google Test trace stack. | | // Pops a trace from the per-thread Google Test trace stack. | |
|
| void PopGTestTrace(); | | void PopGTestTrace() | |
| | | GTEST_LOCK_EXCLUDED_(mutex_); | |
| | | | |
| // Protects mutable state in *impl_. This is mutable as some const | | // Protects mutable state in *impl_. This is mutable as some const | |
| // methods need to lock it too. | | // methods need to lock it too. | |
| mutable internal::Mutex mutex_; | | mutable internal::Mutex mutex_; | |
| | | | |
| // Opaque implementation object. This field is never changed once | | // Opaque implementation object. This field is never changed once | |
| // the object is constructed. We don't mark it as const here, as | | // the object is constructed. We don't mark it as const here, as | |
| // doing so will cause a warning in the constructor of UnitTest. | | // doing so will cause a warning in the constructor of UnitTest. | |
| // Mutable state in *impl_ is protected by mutex_. | | // Mutable state in *impl_ is protected by mutex_. | |
| internal::UnitTestImpl* impl_; | | internal::UnitTestImpl* impl_; | |
| | | | |
| skipping to change at line 1284 | | skipping to change at line 1339 | |
| // | | // | |
| // Calling the function for the second time has no user-visible effect. | | // Calling the function for the second time has no user-visible effect. | |
| GTEST_API_ void InitGoogleTest(int* argc, char** argv); | | GTEST_API_ void InitGoogleTest(int* argc, char** argv); | |
| | | | |
| // This overloaded version can be used in Windows programs compiled in | | // This overloaded version can be used in Windows programs compiled in | |
| // UNICODE mode. | | // UNICODE mode. | |
| GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); | | GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); | |
| | | | |
| namespace internal { | | namespace internal { | |
| | | | |
|
| | | // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a | |
| | | // value of type ToPrint that is an operand of a comparison assertion | |
| | | // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in | |
| | | // the comparison, and is used to help determine the best way to | |
| | | // format the value. In particular, when the value is a C string | |
| | | // (char pointer) and the other operand is an STL string object, we | |
| | | // want to format the C string as a string, since we know it is | |
| | | // compared by value with the string object. If the value is a char | |
| | | // pointer but the other operand is not an STL string object, we don't | |
| | | // know whether the pointer is supposed to point to a NUL-terminated | |
| | | // string, and thus want to print it as a pointer to be safe. | |
| | | // | |
| | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
| | | | |
| | | // The default case. | |
| | | template <typename ToPrint, typename OtherOperand> | |
| | | class FormatForComparison { | |
| | | public: | |
| | | static ::std::string Format(const ToPrint& value) { | |
| | | return ::testing::PrintToString(value); | |
| | | } | |
| | | }; | |
| | | | |
| | | // Array. | |
| | | template <typename ToPrint, size_t N, typename OtherOperand> | |
| | | class FormatForComparison<ToPrint[N], OtherOperand> { | |
| | | public: | |
| | | static ::std::string Format(const ToPrint* value) { | |
| | | return FormatForComparison<const ToPrint*, OtherOperand>::Format(value) | |
| | | ; | |
| | | } | |
| | | }; | |
| | | | |
| | | // By default, print C string as pointers to be safe, as we don't know | |
| | | // whether they actually point to a NUL-terminated string. | |
| | | | |
| | | #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \ | |
| | | template <typename OtherOperand> \ | |
| | | class FormatForComparison<CharType*, OtherOperand> { \ | |
| | | public: \ | |
| | | static ::std::string Format(CharType* value) { \ | |
| | | return ::testing::PrintToString(static_cast<const void*>(value)); \ | |
| | | } \ | |
| | | } | |
| | | | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); | |
| | | | |
| | | #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_ | |
| | | | |
| | | // If a C string is compared with an STL string object, we know it's meant | |
| | | // to point to a NUL-terminated string, and thus can print it as a string. | |
| | | | |
| | | #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \ | |
| | | template <> \ | |
| | | class FormatForComparison<CharType*, OtherStringType> { \ | |
| | | public: \ | |
| | | static ::std::string Format(CharType* value) { \ | |
| | | return ::testing::PrintToString(value); \ | |
| | | } \ | |
| | | } | |
| | | | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string); | |
| | | | |
| | | #if GTEST_HAS_GLOBAL_STRING | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string); | |
| | | #endif | |
| | | | |
| | | #if GTEST_HAS_GLOBAL_WSTRING | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring); | |
| | | #endif | |
| | | | |
| | | #if GTEST_HAS_STD_WSTRING | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring); | |
| | | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring); | |
| | | #endif | |
| | | | |
| | | #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_ | |
| | | | |
| // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) | | // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) | |
| // operand to be used in a failure message. The type (but not value) | | // operand to be used in a failure message. The type (but not value) | |
| // of the other operand may affect the format. This allows us to | | // of the other operand may affect the format. This allows us to | |
| // print a char* as a raw pointer when it is compared against another | | // print a char* as a raw pointer when it is compared against another | |
|
| // char*, and print it as a C string when it is compared against an | | // char* or void*, and print it as a C string when it is compared | |
| // std::string object, for example. | | // against an std::string object, for example. | |
| // | | | |
| // The default implementation ignores the type of the other operand. | | | |
| // Some specialized versions are used to handle formatting wide or | | | |
| // narrow C strings. | | | |
| // | | // | |
| // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
| template <typename T1, typename T2> | | template <typename T1, typename T2> | |
|
| String FormatForComparisonFailureMessage(const T1& value, | | std::string FormatForComparisonFailureMessage( | |
| const T2& /* other_operand */) { | | const T1& value, const T2& /* other_operand */) { | |
| // C++Builder compiles this incorrectly if the namespace isn't explicitly | | return FormatForComparison<T1, T2>::Format(value); | |
| // given. | | | |
| return ::testing::PrintToString(value); | | | |
| } | | } | |
| | | | |
| // The helper function for {ASSERT|EXPECT}_EQ. | | // The helper function for {ASSERT|EXPECT}_EQ. | |
| template <typename T1, typename T2> | | template <typename T1, typename T2> | |
| AssertionResult CmpHelperEQ(const char* expected_expression, | | AssertionResult CmpHelperEQ(const char* expected_expression, | |
| const char* actual_expression, | | const char* actual_expression, | |
| const T1& expected, | | const T1& expected, | |
| const T2& actual) { | | const T2& actual) { | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| # pragma warning(push) // Saves the current warning state. | | # pragma warning(push) // Saves the current warning state. | |
| # pragma warning(disable:4389) // Temporarily disables warning on | | # pragma warning(disable:4389) // Temporarily disables warning on | |
|
| // signed/unsigned mismatch. | | // signed/unsigned mismatch. | |
| #endif | | #endif | |
| | | | |
| if (expected == actual) { | | if (expected == actual) { | |
| return AssertionSuccess(); | | return AssertionSuccess(); | |
| } | | } | |
| | | | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| # pragma warning(pop) // Restores the warning state. | | # pragma warning(pop) // Restores the warning state. | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 1449 | | skipping to change at line 1581 | |
| GTEST_API_ AssertionResult CmpHelper##op_name(\ | | GTEST_API_ AssertionResult CmpHelper##op_name(\ | |
| const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) | | const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) | |
| | | | |
| // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
| | | | |
| // Implements the helper function for {ASSERT|EXPECT}_NE | | // Implements the helper function for {ASSERT|EXPECT}_NE | |
| GTEST_IMPL_CMP_HELPER_(NE, !=); | | GTEST_IMPL_CMP_HELPER_(NE, !=); | |
| // Implements the helper function for {ASSERT|EXPECT}_LE | | // Implements the helper function for {ASSERT|EXPECT}_LE | |
| GTEST_IMPL_CMP_HELPER_(LE, <=); | | GTEST_IMPL_CMP_HELPER_(LE, <=); | |
| // Implements the helper function for {ASSERT|EXPECT}_LT | | // Implements the helper function for {ASSERT|EXPECT}_LT | |
|
| GTEST_IMPL_CMP_HELPER_(LT, < ); | | GTEST_IMPL_CMP_HELPER_(LT, <); | |
| // Implements the helper function for {ASSERT|EXPECT}_GE | | // Implements the helper function for {ASSERT|EXPECT}_GE | |
| GTEST_IMPL_CMP_HELPER_(GE, >=); | | GTEST_IMPL_CMP_HELPER_(GE, >=); | |
| // Implements the helper function for {ASSERT|EXPECT}_GT | | // Implements the helper function for {ASSERT|EXPECT}_GT | |
|
| GTEST_IMPL_CMP_HELPER_(GT, > ); | | GTEST_IMPL_CMP_HELPER_(GT, >); | |
| | | | |
| #undef GTEST_IMPL_CMP_HELPER_ | | #undef GTEST_IMPL_CMP_HELPER_ | |
| | | | |
| // The helper function for {ASSERT|EXPECT}_STREQ. | | // The helper function for {ASSERT|EXPECT}_STREQ. | |
| // | | // | |
| // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | |
| GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, | | GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, | |
| const char* actual_expression, | | const char* actual_expression, | |
| const char* expected, | | const char* expected, | |
| const char* actual); | | const char* actual); | |
| | | | |
| skipping to change at line 1616 | | skipping to change at line 1748 | |
| // re-using stack space even for temporary variables, so every EXPECT_EQ | | // re-using stack space even for temporary variables, so every EXPECT_EQ | |
| // reserves stack space for another AssertHelper. | | // reserves stack space for another AssertHelper. | |
| struct AssertHelperData { | | struct AssertHelperData { | |
| AssertHelperData(TestPartResult::Type t, | | AssertHelperData(TestPartResult::Type t, | |
| const char* srcfile, | | const char* srcfile, | |
| int line_num, | | int line_num, | |
| const char* msg) | | const char* msg) | |
| : type(t), file(srcfile), line(line_num), message(msg) { } | | : type(t), file(srcfile), line(line_num), message(msg) { } | |
| | | | |
| TestPartResult::Type const type; | | TestPartResult::Type const type; | |
|
| const char* const file; | | const char* const file; | |
| int const line; | | int const line; | |
| String const message; | | std::string const message; | |
| | | | |
| private: | | private: | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); | |
| }; | | }; | |
| | | | |
| AssertHelperData* const data_; | | AssertHelperData* const data_; | |
| | | | |
| GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); | | GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 1677 | | skipping to change at line 1809 | |
| class WithParamInterface { | | class WithParamInterface { | |
| public: | | public: | |
| typedef T ParamType; | | typedef T ParamType; | |
| virtual ~WithParamInterface() {} | | virtual ~WithParamInterface() {} | |
| | | | |
| // The current parameter value. Is also available in the test fixture's | | // The current parameter value. Is also available in the test fixture's | |
| // constructor. This member function is non-static, even though it only | | // constructor. This member function is non-static, even though it only | |
| // references static data, to reduce the opportunity for incorrect uses | | // references static data, to reduce the opportunity for incorrect uses | |
| // like writing 'WithParamInterface<bool>::GetParam()' for a test that | | // like writing 'WithParamInterface<bool>::GetParam()' for a test that | |
| // uses a fixture whose parameter type is int. | | // uses a fixture whose parameter type is int. | |
|
| const ParamType& GetParam() const { return *parameter_; } | | const ParamType& GetParam() const { | |
| | | 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?"; | |
| | | return *parameter_; | |
| | | } | |
| | | | |
| private: | | private: | |
| // Sets parameter value. The caller is responsible for making sure the va
lue | | // Sets parameter value. The caller is responsible for making sure the va
lue | |
| // remains alive and unchanged throughout the current test. | | // remains alive and unchanged throughout the current test. | |
| static void SetParam(const ParamType* parameter) { | | static void SetParam(const ParamType* parameter) { | |
| parameter_ = parameter; | | parameter_ = parameter; | |
| } | | } | |
| | | | |
| // Static value used for accessing parameter during a test lifetime. | | // Static value used for accessing parameter during a test lifetime. | |
| static const ParamType* parameter_; | | static const ParamType* parameter_; | |
| | | | |
| skipping to change at line 1723 | | skipping to change at line 1860 | |
| // it behaves like ADD_FAILURE. In particular: | | // it behaves like ADD_FAILURE. In particular: | |
| // | | // | |
| // EXPECT_TRUE verifies that a Boolean condition is true. | | // EXPECT_TRUE verifies that a Boolean condition is true. | |
| // EXPECT_FALSE verifies that a Boolean condition is false. | | // EXPECT_FALSE verifies that a Boolean condition is false. | |
| // | | // | |
| // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except | | // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except | |
| // that they will also abort the current function on failure. People | | // that they will also abort the current function on failure. People | |
| // usually want the fail-fast behavior of FAIL and ASSERT_*, but those | | // usually want the fail-fast behavior of FAIL and ASSERT_*, but those | |
| // writing data-driven tests often find themselves using ADD_FAILURE | | // writing data-driven tests often find themselves using ADD_FAILURE | |
| // and EXPECT_* more. | | // and EXPECT_* more. | |
|
| // | | | |
| // Examples: | | | |
| // | | | |
| // EXPECT_TRUE(server.StatusIsOK()); | | | |
| // ASSERT_FALSE(server.HasPendingRequest(port)) | | | |
| // << "There are still pending requests " << "on port " << port; | | | |
| | | | |
| // Generates a nonfatal failure with a generic message. | | // Generates a nonfatal failure with a generic message. | |
| #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") | | #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") | |
| | | | |
| // Generates a nonfatal failure at the given source file location with | | // Generates a nonfatal failure at the given source file location with | |
| // a generic message. | | // a generic message. | |
| #define ADD_FAILURE_AT(file, line) \ | | #define ADD_FAILURE_AT(file, line) \ | |
| GTEST_MESSAGE_AT_(file, line, "Failed", \ | | GTEST_MESSAGE_AT_(file, line, "Failed", \ | |
| ::testing::TestPartResult::kNonFatalFailure) | | ::testing::TestPartResult::kNonFatalFailure) | |
| | | | |
| | | | |
| skipping to change at line 1902 | | skipping to change at line 2033 | |
| #endif | | #endif | |
| | | | |
| #if !GTEST_DONT_DEFINE_ASSERT_GE | | #if !GTEST_DONT_DEFINE_ASSERT_GE | |
| # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) | | # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) | |
| #endif | | #endif | |
| | | | |
| #if !GTEST_DONT_DEFINE_ASSERT_GT | | #if !GTEST_DONT_DEFINE_ASSERT_GT | |
| # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) | | # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) | |
| #endif | | #endif | |
| | | | |
|
| // C String Comparisons. All tests treat NULL and any non-NULL string | | // C-string Comparisons. All tests treat NULL and any non-NULL string | |
| // as different. Two NULLs are equal. | | // as different. Two NULLs are equal. | |
| // | | // | |
| // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 | | // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 | |
| // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 | | // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 | |
| // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring ca
se | | // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring ca
se | |
| // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring ca
se | | // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring ca
se | |
| // | | // | |
| // For wide or narrow string objects, you can use the | | // For wide or narrow string objects, you can use the | |
| // {ASSERT|EXPECT}_??() macros. | | // {ASSERT|EXPECT}_??() macros. | |
| // | | // | |
| | | | |
| skipping to change at line 2142 | | skipping to change at line 2273 | |
| // | | // | |
| // TEST_F(FooTest, ReturnsElementCountCorrectly) { | | // TEST_F(FooTest, ReturnsElementCountCorrectly) { | |
| // EXPECT_EQ(0, a_.size()); | | // EXPECT_EQ(0, a_.size()); | |
| // EXPECT_EQ(1, b_.size()); | | // EXPECT_EQ(1, b_.size()); | |
| // } | | // } | |
| | | | |
| #define TEST_F(test_fixture, test_name)\ | | #define TEST_F(test_fixture, test_name)\ | |
| GTEST_TEST_(test_fixture, test_name, test_fixture, \ | | GTEST_TEST_(test_fixture, test_name, test_fixture, \ | |
| ::testing::internal::GetTypeId<test_fixture>()) | | ::testing::internal::GetTypeId<test_fixture>()) | |
| | | | |
|
| // Use this macro in main() to run all tests. It returns 0 if all | | } // namespace testing | |
| | | | |
| | | // Use this function in main() to run all tests. It returns 0 if all | |
| // tests are successful, or 1 otherwise. | | // tests are successful, or 1 otherwise. | |
| // | | // | |
| // RUN_ALL_TESTS() should be invoked after the command line has been | | // RUN_ALL_TESTS() should be invoked after the command line has been | |
| // parsed by InitGoogleTest(). | | // parsed by InitGoogleTest(). | |
|
| | | // | |
| | | // This function was formerly a macro; thus, it is in the global | |
| | | // namespace and has an all-caps name. | |
| | | int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; | |
| | | | |
|
| #define RUN_ALL_TESTS()\ | | inline int RUN_ALL_TESTS() { | |
| (::testing::UnitTest::GetInstance()->Run()) | | return ::testing::UnitTest::GetInstance()->Run(); | |
| | | } | |
| } // namespace testing | | | |
| | | | |
| #endif // GTEST_INCLUDE_GTEST_GTEST_H_ | | #endif // GTEST_INCLUDE_GTEST_GTEST_H_ | |
| | | | |
End of changes. 50 change blocks. |
| 88 lines changed or deleted | | 233 lines changed or added | |
|