diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-11 21:59:16 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-11 21:59:16 +0000 |
commit | 459d7bf8f6f1577c67d50c060bff7115d30f9fb9 (patch) | |
tree | 01a168f8ffd72660af8f0c5b33404b06163895a2 /unittests | |
parent | 7042aa598dde44ef74eb3ba1ae729729e64c46cf (diff) | |
download | external_llvm-459d7bf8f6f1577c67d50c060bff7115d30f9fb9.zip external_llvm-459d7bf8f6f1577c67d50c060bff7115d30f9fb9.tar.gz external_llvm-459d7bf8f6f1577c67d50c060bff7115d30f9fb9.tar.bz2 |
Sync SmallBitVector with BitVector. Add unit tests for the missing methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/BitVectorTest.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index 85e1594..d7cde89 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -357,5 +357,41 @@ TYPED_TEST(BitVectorTest, RangeOps) { EXPECT_TRUE( E.test(32)); EXPECT_FALSE(E.test(33)); } + +TYPED_TEST(BitVectorTest, CompoundTestReset) { + TypeParam A(50, true); + TypeParam B(50, false); + + TypeParam C(100, true); + TypeParam D(100, false); + + EXPECT_FALSE(A.test(A)); + EXPECT_TRUE(A.test(B)); + EXPECT_FALSE(A.test(C)); + EXPECT_TRUE(A.test(D)); + EXPECT_FALSE(B.test(A)); + EXPECT_FALSE(B.test(B)); + EXPECT_FALSE(B.test(C)); + EXPECT_FALSE(B.test(D)); + EXPECT_TRUE(C.test(A)); + EXPECT_TRUE(C.test(B)); + EXPECT_FALSE(C.test(C)); + EXPECT_TRUE(C.test(D)); + + A.reset(B); + A.reset(D); + EXPECT_TRUE(A.all()); + A.reset(A); + EXPECT_TRUE(A.none()); + A.set(); + A.reset(C); + EXPECT_TRUE(A.none()); + A.set(); + + C.reset(A); + EXPECT_EQ(50, C.find_first()); + C.reset(C); + EXPECT_TRUE(C.none()); +} } #endif |