From cb7709c89768f912fabe4d84a53c5041e5375165 Mon Sep 17 00:00:00 2001 From: Senichenkov Date: Wed, 27 Nov 2024 10:35:05 +0300 Subject: [PATCH] Convert values explicitly in tests/test_types.cpp Convert double literals to model::DoubleType and model::IntType explicitly, because otherwise clang produces a warning, that becomes an error in debug mode --- src/tests/test_types.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tests/test_types.cpp b/src/tests/test_types.cpp index c0ccf2917f..7e11b6b55f 100644 --- a/src/tests/test_types.cpp +++ b/src/tests/test_types.cpp @@ -97,8 +97,8 @@ TYPED_TEST(TestNumeric, Negate) { }; test(0); - test(-123.5); - test(321.4); + test(typename TypeParam::UnderlyingType(-123.5)); + test(typename TypeParam::UnderlyingType(321.4)); } TYPED_TEST(TestNumeric, Abs) { @@ -108,8 +108,8 @@ TYPED_TEST(TestNumeric, Abs) { }; test(0); - test(-123.5); - test(321.4); + test(typename TypeParam::UnderlyingType(-123.5)); + test(typename TypeParam::UnderlyingType(321.4)); } TYPED_TEST(TestNumeric, Add) { @@ -135,7 +135,7 @@ TYPED_TEST(TestNumeric, Div) { test(0, 100); test(22, 1); test(123, 321); - test(11.4, 3.14); + test(Type(11.4), Type(3.14)); test(-102, 11); test(-123, 123); test(-21, -7); @@ -150,7 +150,7 @@ TYPED_TEST(TestNumeric, Sub) { test(0, 100); test(22, 12); test(123, 321); - test(2.72, 1.3123141); + test(Type(2.72), Type(1.3123141)); test(-102, 11); test(-123, 123); test(-21, -7); @@ -166,7 +166,7 @@ TYPED_TEST(TestNumeric, Mul) { test(100, 0); test(22, 12); test(123, 321); - test(2.72, 1.3123141); + test(Type(2.72), Type(1.3123141)); test(-102, 11); test(-123, 123); test(-21, -7); @@ -183,7 +183,7 @@ TYPED_TEST(TestNumeric, Pow) { test(0, 100); test(22, 12); test(123, 321); - test(2.72, 1.3123141); + test(Type(2.72), Type(1.3123141)); test(-102, 11); test(-123, 123); test(-21, -7); @@ -200,7 +200,7 @@ TYPED_TEST(TestNumeric, Dist) { test(0, 100); test(22, 12); test(123, 321); - test(2.72, 1.3123141); + test(Type(2.72), Type(1.3123141)); test(-102, 11); test(-123, 123); test(-21, -7); @@ -214,8 +214,8 @@ TYPED_TEST(TestNumeric, ValueToString) { test(0); test(123); - test(3.14123123182387); - test(-1231.123456678987654321); + test(typename TypeParam::UnderlyingType(3.14123123182387)); + test(typename TypeParam::UnderlyingType(-1231.123456678987654321)); } struct TestStringParam {