From ee3a73ddbb90f6ebab22e099c34e1aae400a81d1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 24 Jun 2021 19:53:42 +0200 Subject: AK: Rename downcast => verify_cast This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is()). --- Tests/AK/TestVariant.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Tests/AK/TestVariant.cpp') diff --git a/Tests/AK/TestVariant.cpp b/Tests/AK/TestVariant.cpp index 1495fda1a6..2c1b0c725f 100644 --- a/Tests/AK/TestVariant.cpp +++ b/Tests/AK/TestVariant.cpp @@ -77,17 +77,17 @@ TEST_CASE(move_moves) EXPECT(second_variant.has()); } -TEST_CASE(downcast) +TEST_CASE(verify_cast) { Variant one_integer_to_rule_them_all { static_cast(42) }; - auto fake_integer = one_integer_to_rule_them_all.downcast(); + auto fake_integer = one_integer_to_rule_them_all.verify_cast(); EXPECT(fake_integer.has()); EXPECT(one_integer_to_rule_them_all.has()); EXPECT_EQ(fake_integer.get(), 42); EXPECT_EQ(one_integer_to_rule_them_all.get(), 42); fake_integer = static_cast(60); - one_integer_to_rule_them_all = fake_integer.downcast().downcast().downcast(); + one_integer_to_rule_them_all = fake_integer.verify_cast().verify_cast().verify_cast(); EXPECT(fake_integer.has()); EXPECT(one_integer_to_rule_them_all.has()); EXPECT_EQ(fake_integer.get(), 60); -- cgit v1.2.3