Unconditionally use std::tuple.

Remove all mention of TR1 tuple and our own implementation of tuple.

PiperOrigin-RevId: 216395043
This commit is contained in:
Abseil Team
2018-10-09 14:50:26 -04:00
committed by Gennadiy Civil
parent 5434989dbd
commit 7d3b73c85a
34 changed files with 1445 additions and 3729 deletions

View File

@@ -38,7 +38,6 @@
namespace {
using ::testing::tuple;
using ::testing::Matcher;
using ::testing::internal::CompileAssertTypesEqual;
using ::testing::internal::MatcherTuple;
@@ -48,24 +47,24 @@ using ::testing::internal::IgnoredValue;
// Tests the MatcherTuple template struct.
TEST(MatcherTupleTest, ForSize0) {
CompileAssertTypesEqual<tuple<>, MatcherTuple<tuple<> >::type>();
CompileAssertTypesEqual<std::tuple<>, MatcherTuple<std::tuple<> >::type>();
}
TEST(MatcherTupleTest, ForSize1) {
CompileAssertTypesEqual<tuple<Matcher<int> >,
MatcherTuple<tuple<int> >::type>();
CompileAssertTypesEqual<std::tuple<Matcher<int> >,
MatcherTuple<std::tuple<int> >::type>();
}
TEST(MatcherTupleTest, ForSize2) {
CompileAssertTypesEqual<tuple<Matcher<int>, Matcher<char> >,
MatcherTuple<tuple<int, char> >::type>();
CompileAssertTypesEqual<std::tuple<Matcher<int>, Matcher<char> >,
MatcherTuple<std::tuple<int, char> >::type>();
}
TEST(MatcherTupleTest, ForSize5) {
CompileAssertTypesEqual<
tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
Matcher<char*> >,
MatcherTuple<tuple<int, char, bool, double, char*> >::type>();
std::tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
Matcher<char*> >,
MatcherTuple<std::tuple<int, char, bool, double, char*> >::type>();
}
// Tests the Function template struct.
@@ -73,8 +72,8 @@ TEST(MatcherTupleTest, ForSize5) {
TEST(FunctionTest, Nullary) {
typedef Function<int()> F; // NOLINT
CompileAssertTypesEqual<int, F::Result>();
CompileAssertTypesEqual<tuple<>, F::ArgumentTuple>();
CompileAssertTypesEqual<tuple<>, F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<std::tuple<>, F::ArgumentTuple>();
CompileAssertTypesEqual<std::tuple<>, F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(), F::MakeResultVoid>();
CompileAssertTypesEqual<IgnoredValue(), F::MakeResultIgnoredValue>();
}
@@ -83,8 +82,9 @@ TEST(FunctionTest, Unary) {
typedef Function<int(bool)> F; // NOLINT
CompileAssertTypesEqual<int, F::Result>();
CompileAssertTypesEqual<bool, F::Argument1>();
CompileAssertTypesEqual<tuple<bool>, F::ArgumentTuple>();
CompileAssertTypesEqual<tuple<Matcher<bool> >, F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<std::tuple<bool>, F::ArgumentTuple>();
CompileAssertTypesEqual<std::tuple<Matcher<bool> >,
F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool), F::MakeResultVoid>(); // NOLINT
CompileAssertTypesEqual<IgnoredValue(bool), // NOLINT
F::MakeResultIgnoredValue>();
@@ -95,9 +95,10 @@ TEST(FunctionTest, Binary) {
CompileAssertTypesEqual<int, F::Result>();
CompileAssertTypesEqual<bool, F::Argument1>();
CompileAssertTypesEqual<const long&, F::Argument2>(); // NOLINT
CompileAssertTypesEqual<tuple<bool, const long&>, F::ArgumentTuple>(); // NOLINT
CompileAssertTypesEqual<std::tuple<bool, const long&>, // NOLINT
F::ArgumentTuple>();
CompileAssertTypesEqual<
tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
std::tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>(); // NOLINT
CompileAssertTypesEqual<IgnoredValue(bool, const long&), // NOLINT
@@ -112,11 +113,12 @@ TEST(FunctionTest, LongArgumentList) {
CompileAssertTypesEqual<char*, F::Argument3>();
CompileAssertTypesEqual<int&, F::Argument4>();
CompileAssertTypesEqual<const long&, F::Argument5>(); // NOLINT
CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>, // NOLINT
F::ArgumentTuple>();
CompileAssertTypesEqual<
tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
Matcher<const long&> >, // NOLINT
std::tuple<bool, int, char*, int&, const long&>, // NOLINT
F::ArgumentTuple>();
CompileAssertTypesEqual<
std::tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
Matcher<const long&> >, // NOLINT
F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool, int, char*, int&, const long&), // NOLINT
F::MakeResultVoid>();