llvm.org GIT mirror llvm / de61763
[ADT] Avoid warning in bsearch testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358811 91177308-0d34-0410-b5e6-96231b3b80d8 Sam McCall 4 months ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
471471 TEST(STLExtrasTest, bsearch) {
472472 // Integer version.
473473 EXPECT_EQ(7u, bsearch(5, 10, [](unsigned X) { return X >= 7; }));
474 EXPECT_EQ(5u, bsearch(5, 10, [](unsigned X) { return X >= 0; }));
474 EXPECT_EQ(5u, bsearch(5, 10, [](unsigned X) { return X >= 1; }));
475475 EXPECT_EQ(10u, bsearch(5, 10, [](unsigned X) { return X >= 50; }));
476476
477477 // Iterator version.
479479 EXPECT_EQ(V.begin() + 3,
480480 bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 7; }));
481481 EXPECT_EQ(V.begin(),
482 bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 0; }));
482 bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 1; }));
483483 EXPECT_EQ(V.end(),
484484 bsearch(V.begin(), V.end(), [](unsigned X) { return X >= 50; }));
485485
486486 // Range version.
487487 EXPECT_EQ(V.begin() + 3, bsearch(V, [](unsigned X) { return X >= 7; }));
488 EXPECT_EQ(V.begin(), bsearch(V, [](unsigned X) { return X >= 0; }));
488 EXPECT_EQ(V.begin(), bsearch(V, [](unsigned X) { return X >= 1; }));
489489 EXPECT_EQ(V.end(), bsearch(V, [](unsigned X) { return X >= 50; }));
490490 }
491491