diff options
author | Dan Gohman <gohman@apple.com> | 2010-09-27 15:48:37 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-09-27 15:48:37 +0000 |
commit | fab4c9e9df1aeb33b55cfcfa174fac8d61df96fd (patch) | |
tree | 182d681133d46af18a2b80ba257b30588b7b93d8 /unittests | |
parent | 4c6809d8e38b9690898700085ebbd913e035c2e2 (diff) | |
download | external_llvm-fab4c9e9df1aeb33b55cfcfa174fac8d61df96fd.zip external_llvm-fab4c9e9df1aeb33b55cfcfa174fac8d61df96fd.tar.gz external_llvm-fab4c9e9df1aeb33b55cfcfa174fac8d61df96fd.tar.bz2 |
Add an all() method to BitVector, for testing whether all bits are set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/BitVectorTest.cpp | 7 | ||||
-rw-r--r-- | unittests/ADT/SmallBitVectorTest.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index a9fc133..fa66312 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -22,6 +22,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(0U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_TRUE(Vec.empty()); @@ -29,6 +30,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(5U, Vec.count()); EXPECT_EQ(5U, Vec.size()); EXPECT_TRUE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_FALSE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -36,6 +38,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(5U, Vec.count()); EXPECT_EQ(11U, Vec.size()); EXPECT_TRUE(Vec.any()); + EXPECT_FALSE(Vec.all()); EXPECT_FALSE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -43,6 +46,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(6U, Inv.count()); EXPECT_EQ(11U, Inv.size()); EXPECT_TRUE(Inv.any()); + EXPECT_FALSE(Inv.all()); EXPECT_FALSE(Inv.none()); EXPECT_FALSE(Inv.empty()); @@ -123,6 +127,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(130U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_FALSE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -130,6 +135,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Inv.count()); EXPECT_EQ(0U, Inv.size()); EXPECT_FALSE(Inv.any()); + EXPECT_TRUE(Inv.all()); EXPECT_TRUE(Inv.none()); EXPECT_TRUE(Inv.empty()); @@ -137,6 +143,7 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(0U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_TRUE(Vec.empty()); } diff --git a/unittests/ADT/SmallBitVectorTest.cpp b/unittests/ADT/SmallBitVectorTest.cpp index 9c69aad..c4dda9e 100644 --- a/unittests/ADT/SmallBitVectorTest.cpp +++ b/unittests/ADT/SmallBitVectorTest.cpp @@ -19,6 +19,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(0U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_TRUE(Vec.empty()); @@ -26,6 +27,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(5U, Vec.count()); EXPECT_EQ(5U, Vec.size()); EXPECT_TRUE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_FALSE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -33,6 +35,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(5U, Vec.count()); EXPECT_EQ(11U, Vec.size()); EXPECT_TRUE(Vec.any()); + EXPECT_FALSE(Vec.all()); EXPECT_FALSE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -40,6 +43,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(6U, Inv.count()); EXPECT_EQ(11U, Inv.size()); EXPECT_TRUE(Inv.any()); + EXPECT_FALSE(Inv.all()); EXPECT_FALSE(Inv.none()); EXPECT_FALSE(Inv.empty()); @@ -120,6 +124,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(130U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_FALSE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_FALSE(Vec.empty()); @@ -127,6 +132,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Inv.count()); EXPECT_EQ(0U, Inv.size()); EXPECT_FALSE(Inv.any()); + EXPECT_TRUE(Inv.all()); EXPECT_TRUE(Inv.none()); EXPECT_TRUE(Inv.empty()); @@ -134,6 +140,7 @@ TEST(SmallBitVectorTest, TrivialOperation) { EXPECT_EQ(0U, Vec.count()); EXPECT_EQ(0U, Vec.size()); EXPECT_FALSE(Vec.any()); + EXPECT_TRUE(Vec.all()); EXPECT_TRUE(Vec.none()); EXPECT_TRUE(Vec.empty()); } |