[llvm] r358811 - [ADT] Avoid warning in bsearch testcase
Sam McCall via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 20 04:48:12 PDT 2019
Author: sammccall
Date: Sat Apr 20 04:48:11 2019
New Revision: 358811
URL: http://llvm.org/viewvc/llvm-project?rev=358811&view=rev
Log:
[ADT] Avoid warning in bsearch testcase
Modified:
llvm/trunk/unittests/ADT/STLExtrasTest.cpp
Modified: llvm/trunk/unittests/ADT/STLExtrasTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/STLExtrasTest.cpp?rev=358811&r1=358810&r2=358811&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/STLExtrasTest.cpp (original)
+++ llvm/trunk/unittests/ADT/STLExtrasTest.cpp Sat Apr 20 04:48:11 2019
@@ -472,7 +472,7 @@ TEST(STLExtrasTest, to_address) {
TEST(STLExtrasTest, bsearch) {
// Integer version.
EXPECT_EQ(7u, bsearch(5, 10, [](unsigned X) { return X >= 7; }));
- EXPECT_EQ(5u, bsearch(5, 10, [](unsigned X) { return X >= 0; }));
+ EXPECT_EQ(5u, bsearch(5, 10, [](unsigned X) { return X >= 1; }));
EXPECT_EQ(10u, bsearch(5, 10, [](unsigned X) { return X >= 50; }));
// Iterator version.
@@ -480,13 +480,13 @@ TEST(STLExtrasTest, bsearch) {
EXPECT_EQ(V.begin() + 3,
bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 7; }));
EXPECT_EQ(V.begin(),
- bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 0; }));
+ bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 1; }));
EXPECT_EQ(V.end(),
bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 50; }));
// Range version.
EXPECT_EQ(V.begin() + 3, bsearch(V, [](unsigned X) { return X >= 7; }));
- EXPECT_EQ(V.begin(), bsearch(V, [](unsigned X) { return X >= 0; }));
+ EXPECT_EQ(V.begin(), bsearch(V, [](unsigned X) { return X >= 1; }));
EXPECT_EQ(V.end(), bsearch(V, [](unsigned X) { return X >= 50; }));
}
More information about the llvm-commits
mailing list