forked from OSchip/llvm-project
unittest: Convert EXPECT_EQ iterator checks to use EXPECT_TRUE instead
Hopefully fixes compile errors on some bots, like: http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/13383/steps/ninja%20check%201/logs/stdio /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/unittests/ADT/CoalescingBitVectorTest.cpp:452:3: required from here /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h:377:56: error: ‘const class llvm::CoalescingBitVector<long unsigned int>::const_iterator’ has no member named ‘begin’ for (typename C::const_iterator it = container.begin(); ^ /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/llvm/llvm/utils/unittest/googletest/include/gtest/gtest-printers.h:378:11: error: ‘const class llvm::CoalescingBitVector<long unsigned int>::const_iterator’ has no member named ‘end’ it != container.end(); ++it, ++count) { ^
This commit is contained in:
parent
20f508efc0
commit
36789388d0
|
@ -94,25 +94,23 @@ TEST(CoalescingBitVectorTest, Iterators) {
|
|||
|
||||
BV.set({0, 1, 2});
|
||||
|
||||
#if 0
|
||||
auto It = BV.begin();
|
||||
EXPECT_EQ(It, BV.begin());
|
||||
EXPECT_TRUE(It == BV.begin());
|
||||
EXPECT_EQ(*It, 0u);
|
||||
++It;
|
||||
EXPECT_EQ(*It, 1u);
|
||||
++It;
|
||||
EXPECT_EQ(*It, 2u);
|
||||
++It;
|
||||
EXPECT_EQ(It, BV.end());
|
||||
EXPECT_EQ(BV.end(), BV.end());
|
||||
EXPECT_TRUE(It == BV.end());
|
||||
EXPECT_TRUE(BV.end() == BV.end());
|
||||
|
||||
It = BV.begin();
|
||||
EXPECT_EQ(It, BV.begin());
|
||||
EXPECT_TRUE(It == BV.begin());
|
||||
auto ItCopy = It++;
|
||||
EXPECT_EQ(ItCopy, BV.begin());
|
||||
EXPECT_TRUE(ItCopy == BV.begin());
|
||||
EXPECT_EQ(*ItCopy, 0u);
|
||||
EXPECT_EQ(*It, 1u);
|
||||
#endif
|
||||
|
||||
EXPECT_TRUE(elementsMatch(BV, {0, 1, 2}));
|
||||
|
||||
|
@ -132,13 +130,11 @@ TEST(CoalescingBitVectorTest, Iterators) {
|
|||
BV.set({1000, 1001, 1002});
|
||||
EXPECT_TRUE(elementsMatch(BV, {0, 1, 2, 4, 5, 6, 10, 1000, 1001, 1002}));
|
||||
|
||||
#if 0
|
||||
auto It1 = BV.begin();
|
||||
EXPECT_EQ(It1, BV.begin());
|
||||
EXPECT_EQ(++It1, ++BV.begin());
|
||||
EXPECT_NE(It1, BV.begin());
|
||||
EXPECT_NE(It1, BV.end());
|
||||
#endif
|
||||
EXPECT_TRUE(It1 == BV.begin());
|
||||
EXPECT_TRUE(++It1 == ++BV.begin());
|
||||
EXPECT_TRUE(It1 != BV.begin());
|
||||
EXPECT_TRUE(It1 != BV.end());
|
||||
}
|
||||
|
||||
TEST(CoalescingBitVectorTest, Reset) {
|
||||
|
@ -449,7 +445,7 @@ TEST(CoalescingBitVectorTest, FindLowerBound) {
|
|||
U64BitVec BV(Alloc);
|
||||
uint64_t BigNum1 = uint64_t(1) << 32;
|
||||
uint64_t BigNum2 = (uint64_t(1) << 33) + 1;
|
||||
EXPECT_EQ(BV.find(BigNum1), BV.end());
|
||||
EXPECT_TRUE(BV.find(BigNum1) == BV.end());
|
||||
BV.set(BigNum1);
|
||||
auto Find1 = BV.find(BigNum1);
|
||||
EXPECT_EQ(*Find1, BigNum1);
|
||||
|
|
Loading…
Reference in New Issue