From b200e74715e8cac7ec9ac3ca47c1367b859d3503 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Tue, 29 Nov 2022 19:32:46 +0000 Subject: [PATCH] tint: simplify const eval binary op unit tests Use the scalar overload of the case creation function. Bug: tint:1581 Change-Id: I01b0d09ed99a9835583b1cee02ec323d2f2a546f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112204 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Antonio Maiorano --- .../resolver/const_eval_binary_op_test.cc | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/tint/resolver/const_eval_binary_op_test.cc b/src/tint/resolver/const_eval_binary_op_test.cc index f621c61f65..2a13360202 100644 --- a/src/tint/resolver/const_eval_binary_op_test.cc +++ b/src/tint/resolver/const_eval_binary_op_test.cc @@ -454,16 +454,16 @@ std::vector OpDivFloatCases() { return "12:34 error: " + OverflowErrorMessage(a, "/", b); }; std::vector r = { - C(Val(T{0}), Val(T{1}), Val(T{0})), - C(Val(T{1}), Val(T{1}), Val(T{1})), - C(Val(T{1}), Val(T{1}), Val(T{1})), - C(Val(T{2}), Val(T{1}), Val(T{2})), - C(Val(T{4}), Val(T{2}), Val(T{2})), - C(Val(T::Highest()), Val(T{1}), Val(T::Highest())), - C(Val(T::Lowest()), Val(T{1}), Val(T::Lowest())), - C(Val(T::Highest()), Val(T::Highest()), Val(T{1})), - C(Val(T{0}), Val(T::Highest()), Val(T{0})), - C(Val(T{0}), Val(T::Lowest()), Val(-T{0})), + C(T{0}, T{1}, T{0}), + C(T{1}, T{1}, T{1}), + C(T{1}, T{1}, T{1}), + C(T{2}, T{1}, T{2}), + C(T{4}, T{2}, T{2}), + C(T::Highest(), T{1}, T::Highest()), + C(T::Lowest(), T{1}, T::Lowest()), + C(T::Highest(), T::Highest(), T{1}), + C(T{0}, T::Highest(), T{0}), + C(T{0}, T::Lowest(), -T{0}), // Divide by zero E(T{123}, T{0}, error_msg(T{123}, T{0})), @@ -488,10 +488,10 @@ INSTANTIATE_TEST_SUITE_P(Div, template std::vector OpEqualCases() { return { - C(Val(T{0}), Val(T{0}), Val(true == equals)), - C(Val(T{0}), Val(T{1}), Val(false == equals)), - C(Val(T{1}), Val(T{0}), Val(false == equals)), - C(Val(T{1}), Val(T{1}), Val(true == equals)), + C(T{0}, T{0}, true == equals), + C(T{0}, T{1}, false == equals), + C(T{1}, T{0}, false == equals), + C(T{1}, T{1}, true == equals), C(Vec(T{0}, T{0}), Vec(T{0}, T{0}), Vec(true == equals, true == equals)), C(Vec(T{1}, T{0}), Vec(T{0}, T{1}), Vec(false == equals, false == equals)), C(Vec(T{1}, T{1}), Vec(T{0}, T{1}), Vec(false == equals, true == equals)), @@ -525,10 +525,10 @@ INSTANTIATE_TEST_SUITE_P(NotEqual, template std::vector OpLessThanCases() { return { - C(Val(T{0}), Val(T{0}), Val(false == less_than)), - C(Val(T{0}), Val(T{1}), Val(true == less_than)), - C(Val(T{1}), Val(T{0}), Val(false == less_than)), - C(Val(T{1}), Val(T{1}), Val(false == less_than)), + C(T{0}, T{0}, false == less_than), + C(T{0}, T{1}, true == less_than), + C(T{1}, T{0}, false == less_than), + C(T{1}, T{1}, false == less_than), C(Vec(T{0}, T{0}), Vec(T{0}, T{0}), Vec(false == less_than, false == less_than)), C(Vec(T{0}, T{0}), Vec(T{1}, T{1}), Vec(true == less_than, true == less_than)), C(Vec(T{1}, T{1}), Vec(T{0}, T{0}), Vec(false == less_than, false == less_than)), @@ -561,10 +561,10 @@ INSTANTIATE_TEST_SUITE_P(GreaterThanEqual, template std::vector OpGreaterThanCases() { return { - C(Val(T{0}), Val(T{0}), Val(false == greater_than)), - C(Val(T{0}), Val(T{1}), Val(false == greater_than)), - C(Val(T{1}), Val(T{0}), Val(true == greater_than)), - C(Val(T{1}), Val(T{1}), Val(false == greater_than)), + C(T{0}, T{0}, false == greater_than), + C(T{0}, T{1}, false == greater_than), + C(T{1}, T{0}, true == greater_than), + C(T{1}, T{1}, false == greater_than), C(Vec(T{0}, T{0}), Vec(T{0}, T{0}), Vec(false == greater_than, false == greater_than)), C(Vec(T{1}, T{1}), Vec(T{0}, T{0}), Vec(true == greater_than, true == greater_than)), C(Vec(T{0}, T{0}), Vec(T{1}, T{1}), Vec(false == greater_than, false == greater_than)),