diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-12 19:54:08 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-12 19:54:08 +0000 |
commit | 28ac334addef825e3fa410f5b7de0816c2a7af85 (patch) | |
tree | 73ee8ae85590bf4c2a55f5256fa7faef664ba547 /llvm/unittests/ADT/IteratorTest.cpp | |
parent | 8271be9a1da41ac9221fc13831a9166ddf53a002 (diff) | |
download | bcm5719-llvm-28ac334addef825e3fa410f5b7de0816c2a7af85.tar.gz bcm5719-llvm-28ac334addef825e3fa410f5b7de0816c2a7af85.zip |
Revert "[ADT] Zip range adapter"
This reverts commit r284035, which breaks with MSVC 2013.
llvm-svn: 284037
Diffstat (limited to 'llvm/unittests/ADT/IteratorTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/IteratorTest.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/llvm/unittests/ADT/IteratorTest.cpp b/llvm/unittests/ADT/IteratorTest.cpp index a8d5b33a0b4..4f1d81d487d 100644 --- a/llvm/unittests/ADT/IteratorTest.cpp +++ b/llvm/unittests/ADT/IteratorTest.cpp @@ -209,67 +209,4 @@ TEST(PointerIterator, Const) { EXPECT_EQ(A + 4, std::next(*Begin, 4)); } -TEST(ZipIteratorTest, Basic) { - using namespace std; - const SmallVector<unsigned, 6> pi{3, 1, 4, 1, 5, 9}; - SmallVector<bool, 6> odd{1, 1, 0, 1, 1, 1}; - const char message[] = "yynyyy\0"; - - for (auto tup : zip(pi, odd, message)) { - EXPECT_EQ(get<0>(tup) & 0x01, get<1>(tup)); - EXPECT_EQ(get<0>(tup) & 0x01 ? 'y' : 'n', get<2>(tup)); - } - - // note the rvalue - for (auto tup : zip(pi, SmallVector<bool, 0>{1, 1, 0, 1, 1})) { - EXPECT_EQ(get<0>(tup) & 0x01, get<1>(tup)); - } -} - -TEST(ZipIteratorTest, ZipFirstBasic) { - using namespace std; - const SmallVector<unsigned, 6> pi{3, 1, 4, 1, 5, 9}; - unsigned iters = 0; - - for (auto tup : zip_first(SmallVector<bool, 0>{1, 1, 0, 1}, pi)) { - EXPECT_EQ(get<0>(tup), get<1>(tup) & 0x01); - iters += 1; - } - - EXPECT_EQ(iters, 4u); -} - -TEST(ZipIteratorTest, Mutability) { - using namespace std; - const SmallVector<unsigned, 4> pi{3, 1, 4, 1, 5, 9}; - char message[] = "hello zip\0"; - - for (auto tup : zip(pi, message, message)) { - EXPECT_EQ(get<1>(tup), get<2>(tup)); - get<2>(tup) = get<0>(tup) & 0x01 ? 'y' : 'n'; - } - - // note the rvalue - for (auto tup : zip(message, "yynyyyzip\0")) { - EXPECT_EQ(get<0>(tup), get<1>(tup)); - } -} - -TEST(ZipIteratorTest, ZipFirstMutability) { - using namespace std; - vector<unsigned> pi{3, 1, 4, 1, 5, 9}; - unsigned iters = 0; - - for (auto tup : zip_first(SmallVector<bool, 0>{1, 1, 0, 1}, pi)) { - get<1>(tup) = get<0>(tup); - iters += 1; - } - - EXPECT_EQ(iters, 4u); - - for (auto tup : zip_first(SmallVector<bool, 0>{1, 1, 0, 1}, pi)) { - EXPECT_EQ(get<0>(tup), get<1>(tup)); - } -} - } // anonymous namespace |