diff options
author | Abseil Team <absl-team@google.com> | 2019-10-10 17:12:54 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-10-11 11:06:56 (GMT) |
commit | ed78e54f38ab10c775e39e5c4d500c6134a60d64 (patch) | |
tree | d911208bec3165eeaaf5a12f48181d25aa7be489 /googletest/test/gtest_unittest.cc | |
parent | 58c71977611c0019cf077e43fb54bc3326409a43 (diff) | |
download | googletest-ed78e54f38ab10c775e39e5c4d500c6134a60d64.zip googletest-ed78e54f38ab10c775e39e5c4d500c6134a60d64.tar.gz googletest-ed78e54f38ab10c775e39e5c4d500c6134a60d64.tar.bz2 |
Googletest export
Fix the O(n^2) number of instantiations in ElemFromList.
It is now O(n). It still has O(1) instantiation depth.
PiperOrigin-RevId: 273980821
Diffstat (limited to 'googletest/test/gtest_unittest.cc')
-rw-r--r-- | googletest/test/gtest_unittest.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 05ee1c7..8312bd1 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -7353,20 +7353,15 @@ TEST(IndexSequence, MakeIndexSequence) { // ElemFromList TEST(ElemFromList, Basic) { using testing::internal::ElemFromList; - using Idx = testing::internal::MakeIndexSequence<3>::type; - EXPECT_TRUE(( - std::is_same<int, ElemFromList<0, Idx, int, double, char>::type>::value)); EXPECT_TRUE( - (std::is_same<double, - ElemFromList<1, Idx, int, double, char>::type>::value)); + (std::is_same<int, ElemFromList<0, int, double, char>::type>::value)); EXPECT_TRUE( - (std::is_same<char, - ElemFromList<2, Idx, int, double, char>::type>::value)); + (std::is_same<double, ElemFromList<1, int, double, char>::type>::value)); EXPECT_TRUE( - (std::is_same< - char, ElemFromList<7, testing::internal::MakeIndexSequence<12>::type, - int, int, int, int, int, int, int, char, int, int, - int, int>::type>::value)); + (std::is_same<char, ElemFromList<2, int, double, char>::type>::value)); + EXPECT_TRUE(( + std::is_same<char, ElemFromList<7, int, int, int, int, int, int, int, + char, int, int, int, int>::type>::value)); } // FlatTuple |