diff options
author | Kaelyn Takata <rikka@google.com> | 2014-10-07 23:11:49 +0000 |
---|---|---|
committer | Kaelyn Takata <rikka@google.com> | 2014-10-07 23:11:49 +0000 |
commit | 1353fe8bdebddc1d116e7aadc5a53901057b5c84 (patch) | |
tree | 104b27f7650f30a3cdc1908c3a445adf6a7a0c77 /llvm/unittests/ADT/MapVectorTest.cpp | |
parent | c6c6c7b177e2c42fb67bc5a215aa1f181a40ca5c (diff) | |
download | bcm5719-llvm-1353fe8bdebddc1d116e7aadc5a53901057b5c84.tar.gz bcm5719-llvm-1353fe8bdebddc1d116e7aadc5a53901057b5c84.zip |
Add return value and negative checks to MapVector::erase from r219240.
llvm-svn: 219250
Diffstat (limited to 'llvm/unittests/ADT/MapVectorTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/MapVectorTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/ADT/MapVectorTest.cpp b/llvm/unittests/ADT/MapVectorTest.cpp index 0580580977e..46cd36acea9 100644 --- a/llvm/unittests/ADT/MapVectorTest.cpp +++ b/llvm/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) { |