From 2ad747dedd99d4f88742295f2760ae35759b2dd9 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Tue, 11 Oct 2022 21:29:28 +0000 Subject: [PATCH] tint: Fix const eval unary tests I broke this in a recent CL: https://dawn-review.googlesource.com/c/dawn/+/104424 Bug: tint:1709 Change-Id: I930a57bae723e18708d4f746ed66d24378518df4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105461 Commit-Queue: Antonio Maiorano Kokoro: Kokoro Reviewed-by: Ben Clayton --- src/tint/resolver/const_eval_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tint/resolver/const_eval_test.cc b/src/tint/resolver/const_eval_test.cc index b966097425..cf3cda037e 100644 --- a/src/tint/resolver/const_eval_test.cc +++ b/src/tint/resolver/const_eval_test.cc @@ -3280,12 +3280,14 @@ TEST_P(ResolverConstEvalUnaryOpTest, Test) { using T = typename std::decay_t::ElementType; auto* input_expr = std::visit([&](auto&& value) { return value.Expr(*this); }, c.input); - auto* expected_expr = create(op, input_expr); - GlobalConst("C", expected_expr); + auto* expr = create(op, input_expr); - EXPECT_TRUE(r()->Resolve()) << r()->error(); + GlobalConst("C", expr); + auto* expected_expr = expected.Expr(*this); + GlobalConst("E", expected_expr); + ASSERT_TRUE(r()->Resolve()) << r()->error(); - auto* sem = Sem().Get(expected_expr); + auto* sem = Sem().Get(expr); const sem::Constant* value = sem->ConstantValue(); ASSERT_NE(value, nullptr); EXPECT_TYPE(value->Type(), sem->Type());