Skip to content

Commit 0753244

Browse files
[ADT] Use separate variables in a unit test for SmallPtrSet (NFC) (#131748)
1 parent f179daf commit 0753244

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/unittests/ADT/SmallPtrSetTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,13 @@ TEST(SmallPtrSetTest, RemoveIf) {
412412
}
413413

414414
TEST(SmallPtrSetTest, InsertRange) {
415-
int Vals[3] = {0, 1, 2};
415+
int V0 = 0;
416+
int V1 = 1;
417+
int V2 = 2;
416418
SmallPtrSet<int *, 4> Set;
417-
int *Args[] = {&Vals[2], &Vals[0], &Vals[1]};
419+
int *Args[] = {&V2, &V0, &V1};
418420
Set.insert_range(Args);
419-
EXPECT_THAT(Set, UnorderedElementsAre(&Vals[0], &Vals[1], &Vals[2]));
421+
EXPECT_THAT(Set, UnorderedElementsAre(&V0, &V1, &V2));
420422
}
421423

422424
TEST(SmallPtrSetTest, Reserve) {

0 commit comments

Comments
 (0)