1 //===- llvm/unittest/ADT/SetVector.cpp ------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // SetVector unit tests.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/SetVector.h"
15 #include "gtest/gtest.h"
19 TEST(SetVector
, EraseTest
) {
25 auto I
= S
.erase(std::next(S
.begin()));
27 // Test that the returned iterator is the expected one-after-erase
28 // and the size/contents is the expected sequence {0, 2}.
29 EXPECT_EQ(std::next(S
.begin()), I
);
30 EXPECT_EQ(2u, S
.size());
31 EXPECT_EQ(0, *S
.begin());
32 EXPECT_EQ(2, *std::next(S
.begin()));