aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/samples
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-10-09 14:50:26 -0400
committerGennadiy Civil <misterg@google.com>2018-10-09 16:25:58 -0400
commit7d3b73c85a42811309eac26e5cbe054c40b64785 (patch)
tree589142a210a7bf1ccfd51180586a35c4a6f73b68 /googletest/samples
parent5434989dbd8a15f14f33cbeb9d94801247031c95 (diff)
downloadgoogletest-7d3b73c85a42811309eac26e5cbe054c40b64785.tar.gz
googletest-7d3b73c85a42811309eac26e5cbe054c40b64785.tar.bz2
googletest-7d3b73c85a42811309eac26e5cbe054c40b64785.zip
Unconditionally use std::tuple.
Remove all mention of TR1 tuple and our own implementation of tuple. PiperOrigin-RevId: 216395043
Diffstat (limited to 'googletest/samples')
-rw-r--r--googletest/samples/sample8_unittest.cc27
1 files changed, 4 insertions, 23 deletions
diff --git a/googletest/samples/sample8_unittest.cc b/googletest/samples/sample8_unittest.cc
index ccf5aed7..a3eacc73 100644
--- a/googletest/samples/sample8_unittest.cc
+++ b/googletest/samples/sample8_unittest.cc
@@ -37,7 +37,6 @@
#include "gtest/gtest.h"
namespace {
-#if GTEST_HAS_COMBINE
// Suppose we want to introduce a new, improved implementation of PrimeTable
// which combines speed of PrecalcPrimeTable and versatility of
@@ -90,19 +89,12 @@ using ::testing::Combine;
// PreCalculatedPrimeTable disabled. We do this by defining fixture which will
// accept different combinations of parameters for instantiating a
// HybridPrimeTable instance.
-class PrimeTableTest : public TestWithParam< ::testing::tuple<bool, int> > {
+class PrimeTableTest : public TestWithParam< ::std::tuple<bool, int> > {
protected:
virtual void SetUp() {
- // This can be written as
- //
- // bool force_on_the_fly;
- // int max_precalculated;
- // tie(force_on_the_fly, max_precalculated) = GetParam();
- //
- // once the Google C++ Style Guide allows use of ::std::tr1::tie.
- //
- bool force_on_the_fly = ::testing::get<0>(GetParam());
- int max_precalculated = ::testing::get<1>(GetParam());
+ bool force_on_the_fly;
+ int max_precalculated;
+ std::tie(force_on_the_fly, max_precalculated) = GetParam();
table_ = new HybridPrimeTable(force_on_the_fly, max_precalculated);
}
virtual void TearDown() {
@@ -160,15 +152,4 @@ INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
PrimeTableTest,
Combine(Bool(), Values(1, 10)));
-#else
-
-// Google Test may not support Combine() with some compilers. If we
-// use conditional compilation to compile out all code referring to
-// the gtest_main library, MSVC linker will not link that library at
-// all and consequently complain about missing entry point defined in
-// that library (fatal error LNK1561: entry point must be
-// defined). This dummy test keeps gtest_main linked in.
-TEST(DummyTest, CombineIsNotSupportedOnThisPlatform) {}
-
-#endif // GTEST_HAS_COMBINE
} // namespace