From: Kaelyn Takata Date: Tue, 7 Oct 2014 23:11:49 +0000 (+0000) Subject: Add return value and negative checks to MapVector::erase from r219240. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=502b4d1e96e1ba77de6e0b3e68ba4f7d727da8c7 Add return value and negative checks to MapVector::erase from r219240. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219250 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ADT/MapVectorTest.cpp b/unittests/ADT/MapVectorTest.cpp index 0580580977e..46cd36acea9 100644 --- a/unittests/ADT/MapVectorTest.cpp +++ b/unittests/ADT/MapVectorTest.cpp @@ -68,10 +68,13 @@ TEST(MapVectorTest, erase) { ASSERT_EQ(MV[3], 4); ASSERT_EQ(MV[5], 6); - MV.erase(3); + ASSERT_EQ(MV.erase(3), 1u); ASSERT_EQ(MV.size(), 1u); ASSERT_EQ(MV.find(3), MV.end()); ASSERT_EQ(MV[5], 6); + + ASSERT_EQ(MV.erase(79), 0u); + ASSERT_EQ(MV.size(), 1u); } TEST(MapVectorTest, remove_if) {