[llvm] 0753244 - [ADT] Use separate variables in a unit test for SmallPtrSet (NFC) (#131748)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 18 07:53:56 PDT 2025
Author: Kazu Hirata
Date: 2025-03-18T07:53:52-07:00
New Revision: 075324461d4179f85d2b94397b11b9dfb788e0f5
URL: https://github.com/llvm/llvm-project/commit/075324461d4179f85d2b94397b11b9dfb788e0f5
DIFF: https://github.com/llvm/llvm-project/commit/075324461d4179f85d2b94397b11b9dfb788e0f5.diff
LOG: [ADT] Use separate variables in a unit test for SmallPtrSet (NFC) (#131748)
Added:
Modified:
llvm/unittests/ADT/SmallPtrSetTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
index 2a634a68d6e66..fb002cce65092 100644
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
@@ -412,11 +412,13 @@ TEST(SmallPtrSetTest, RemoveIf) {
}
TEST(SmallPtrSetTest, InsertRange) {
- int Vals[3] = {0, 1, 2};
+ int V0 = 0;
+ int V1 = 1;
+ int V2 = 2;
SmallPtrSet<int *, 4> Set;
- int *Args[] = {&Vals[2], &Vals[0], &Vals[1]};
+ int *Args[] = {&V2, &V0, &V1};
Set.insert_range(Args);
- EXPECT_THAT(Set, UnorderedElementsAre(&Vals[0], &Vals[1], &Vals[2]));
+ EXPECT_THAT(Set, UnorderedElementsAre(&V0, &V1, &V2));
}
TEST(SmallPtrSetTest, Reserve) {
More information about the llvm-commits
mailing list