42using ::testing::tuple;
43using ::testing::Matcher;
44using ::testing::internal::CompileAssertTypesEqual;
45using ::testing::internal::MatcherTuple;
46using ::testing::internal::Function;
47using ::testing::internal::IgnoredValue;
51TEST(MatcherTupleTest, ForSize0) {
52 CompileAssertTypesEqual<tuple<>, MatcherTuple<tuple<> >::type>();
55TEST(MatcherTupleTest, ForSize1) {
56 CompileAssertTypesEqual<tuple<Matcher<int> >,
57 MatcherTuple<tuple<int> >::type>();
60TEST(MatcherTupleTest, ForSize2) {
61 CompileAssertTypesEqual<tuple<Matcher<int>, Matcher<char> >,
62 MatcherTuple<tuple<int, char> >::type>();
65TEST(MatcherTupleTest, ForSize5) {
66 CompileAssertTypesEqual<
67 tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
69 MatcherTuple<tuple<int, char, bool, double, char*> >::type>();
74TEST(FunctionTest, Nullary) {
76 CompileAssertTypesEqual<int, F::Result>();
77 CompileAssertTypesEqual<tuple<>, F::ArgumentTuple>();
78 CompileAssertTypesEqual<tuple<>, F::ArgumentMatcherTuple>();
79 CompileAssertTypesEqual<void(), F::MakeResultVoid>();
80 CompileAssertTypesEqual<IgnoredValue(), F::MakeResultIgnoredValue>();
85 CompileAssertTypesEqual<int, F::Result>();
86 CompileAssertTypesEqual<bool, F::Argument1>();
87 CompileAssertTypesEqual<tuple<bool>, F::ArgumentTuple>();
88 CompileAssertTypesEqual<tuple<Matcher<bool> >, F::ArgumentMatcherTuple>();
89 CompileAssertTypesEqual<void(bool), F::MakeResultVoid>();
90 CompileAssertTypesEqual<IgnoredValue(
bool),
91 F::MakeResultIgnoredValue>();
95 typedef Function<int(
bool,
const long&)> F;
96 CompileAssertTypesEqual<int, F::Result>();
97 CompileAssertTypesEqual<bool, F::Argument1>();
98 CompileAssertTypesEqual<const long&, F::Argument2>();
99 CompileAssertTypesEqual<tuple<bool, const long&>, F::ArgumentTuple>();
100 CompileAssertTypesEqual<
101 tuple<Matcher<bool>, Matcher<const long&> >,
102 F::ArgumentMatcherTuple>();
103 CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>();
104 CompileAssertTypesEqual<IgnoredValue(
bool,
const long&),
105 F::MakeResultIgnoredValue>();
108TEST(FunctionTest, LongArgumentList) {
109 typedef Function<char(
bool,
int,
char*,
int&,
const long&)> F;
110 CompileAssertTypesEqual<char, F::Result>();
111 CompileAssertTypesEqual<bool, F::Argument1>();
112 CompileAssertTypesEqual<int, F::Argument2>();
113 CompileAssertTypesEqual<char*, F::Argument3>();
114 CompileAssertTypesEqual<int&, F::Argument4>();
115 CompileAssertTypesEqual<const long&, F::Argument5>();
116 CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>,
118 CompileAssertTypesEqual<
119 tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
120 Matcher<const long&> >,
121 F::ArgumentMatcherTuple>();
122 CompileAssertTypesEqual<void(
bool,
int,
char*,
int&,
const long&),
123 F::MakeResultVoid>();
124 CompileAssertTypesEqual<
125 IgnoredValue(
bool,
int,
char*,
int&,
const long&),
126 F::MakeResultIgnoredValue>();
#define TEST(test_case_name, test_name)