summaryrefslogtreecommitdiff
path: root/unittests/ADT/IntervalMapTest.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-19 23:28:57 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-19 23:28:57 +0000
commit655fbb4f9b46ea93eddf0815eaed0020e9347416 (patch)
tree9492e0149af445cfaa703b4b7f6781ebeae62f24 /unittests/ADT/IntervalMapTest.cpp
parentdb52566d684a36cf1f320f91ca5c15d5cd075b95 (diff)
downloadllvm-655fbb4f9b46ea93eddf0815eaed0020e9347416.tar.gz
llvm-655fbb4f9b46ea93eddf0815eaed0020e9347416.tar.bz2
llvm-655fbb4f9b46ea93eddf0815eaed0020e9347416.tar.xz
Implement IntervalMap::clear().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT/IntervalMapTest.cpp')
-rw-r--r--unittests/ADT/IntervalMapTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/ADT/IntervalMapTest.cpp b/unittests/ADT/IntervalMapTest.cpp
index c7def84340..d4b2f52b50 100644
--- a/unittests/ADT/IntervalMapTest.cpp
+++ b/unittests/ADT/IntervalMapTest.cpp
@@ -315,6 +315,11 @@ TEST(IntervalMapTest, RootMultiCoalescing) {
EXPECT_EQ(320u, I.stop());
++I;
EXPECT_FALSE(I.valid());
+
+ // Test clear() on non-branched map.
+ map.clear();
+ EXPECT_TRUE(map.empty());
+ EXPECT_TRUE(map.begin() == map.end());
}
// Branched, non-coalescing tests.
@@ -362,6 +367,10 @@ TEST(IntervalMapTest, Branched) {
}
EXPECT_TRUE(I == map.begin());
+ // Test clear() on branched map.
+ map.clear();
+ EXPECT_TRUE(map.empty());
+ EXPECT_TRUE(map.begin() == map.end());
}
} // namespace