38#include "gtest/gtest.h"
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<tuple<Matcher<int>, Matcher<char>, Matcher<bool>,
67 Matcher<double>, Matcher<char*> >,
68 MatcherTuple<tuple<int, char, bool, double, char*>
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>();
83TEST(FunctionTest, Unary) {
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>();
94TEST(FunctionTest, Binary) {
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<tuple<Matcher<bool>, Matcher<const long&> >,
101 F::ArgumentMatcherTuple>();
102 CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>();
103 CompileAssertTypesEqual<IgnoredValue(
bool,
const long&),
104 F::MakeResultIgnoredValue>();
107TEST(FunctionTest, LongArgumentList) {
108 typedef Function<char(
bool,
int,
char*,
int&,
const long&)>
F;
109 CompileAssertTypesEqual<char, F::Result>();
110 CompileAssertTypesEqual<bool, F::Argument1>();
111 CompileAssertTypesEqual<int, F::Argument2>();
112 CompileAssertTypesEqual<char*, F::Argument3>();
113 CompileAssertTypesEqual<int&, F::Argument4>();
114 CompileAssertTypesEqual<const long&, F::Argument5>();
115 CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>,
117 CompileAssertTypesEqual<tuple<Matcher<bool>, Matcher<int>, Matcher<char*>,
118 Matcher<int&>, Matcher<const long&> >,
119 F::ArgumentMatcherTuple>();
120 CompileAssertTypesEqual<void(
bool,
int,
char*,
int&,
const long&),
121 F::MakeResultVoid>();
122 CompileAssertTypesEqual<
123 IgnoredValue(
bool,
int,
char*,
int&,
const long&),
124 F::MakeResultIgnoredValue>();
#define TEST(test_case_name, test_name)
Definition gtest.h:2187
int
Definition pymoduletest.py:17
#define F(w, k)
Definition sha512-blocks.c:61