From b252fbd179c494b3c6220f6f7e42f3ff5d15bda6 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 30 Apr 2010 12:29:39 +0000 Subject: Implement a read/write operator[] for SmallBitVector with a proxy class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102709 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ADT/SmallBitVectorTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'unittests') diff --git a/unittests/ADT/SmallBitVectorTest.cpp b/unittests/ADT/SmallBitVectorTest.cpp index a2cc652ca..a0c079d 100644 --- a/unittests/ADT/SmallBitVectorTest.cpp +++ b/unittests/ADT/SmallBitVectorTest.cpp @@ -176,4 +176,12 @@ TEST(SmallBitVectorTest, CompoundAssignment) { EXPECT_EQ(100U, A.size()); } +TEST(SmallBitVectorTest, ProxyIndex) { + SmallBitVector Vec(3); + EXPECT_TRUE(Vec.none()); + Vec[0] = Vec[1] = Vec[2] = true; + EXPECT_EQ(Vec.size(), Vec.count()); + Vec[2] = Vec[1] = Vec[0] = false; + EXPECT_TRUE(Vec.none()); +} } -- cgit v1.1