diff --git a/unittests/ADT/STLExtrasTest.cpp b/unittests/ADT/STLExtrasTest.cpp index 2c2b6490308..85208e4f4a2 100644 --- a/unittests/ADT/STLExtrasTest.cpp +++ b/unittests/ADT/STLExtrasTest.cpp @@ -777,9 +777,9 @@ TEST(STLExtrasTest, MakeVisitorOneCallable) { TEST(STLExtrasTest, MakeVisitorTwoCallables) { auto Visitor = - makeVisitor([](int) { return "int"; }, [](std::string) { return "str"; }); - EXPECT_EQ(Visitor(42), "int"); - EXPECT_EQ(Visitor("foo"), "str"); + makeVisitor([](int) { return 0; }, [](std::string) { return 1; }); + EXPECT_EQ(Visitor(42), 0); + EXPECT_EQ(Visitor("foo"), 1); } TEST(STLExtrasTest, MakeVisitorCallableMultipleOperands) { @@ -793,20 +793,20 @@ TEST(STLExtrasTest, MakeVisitorDefaultCase) { { auto Visitor = makeVisitor([](int I) { return I + 100; }, [](float F) { return F * 2; }, - [](auto) { return "unhandled type"; }); + [](auto) { return -1; }); EXPECT_EQ(Visitor(24), 124); EXPECT_EQ(Visitor(2.f), 4.f); - EXPECT_EQ(Visitor(2.), "unhandled type"); - EXPECT_EQ(Visitor(Visitor), "unhandled type"); + EXPECT_EQ(Visitor(2.), -1); + EXPECT_EQ(Visitor(Visitor), -1); } { - auto Visitor = makeVisitor([](auto) { return "unhandled type"; }, + auto Visitor = makeVisitor([](auto) { return -1; }, [](int I) { return I + 100; }, [](float F) { return F * 2; }); EXPECT_EQ(Visitor(24), 124); EXPECT_EQ(Visitor(2.f), 4.f); - EXPECT_EQ(Visitor(2.), "unhandled type"); - EXPECT_EQ(Visitor(Visitor), "unhandled type"); + EXPECT_EQ(Visitor(2.), -1); + EXPECT_EQ(Visitor(Visitor), -1); } }