Skip to content

Commit

Permalink
Convert values explicitly in tests/test_types.cpp
Browse files Browse the repository at this point in the history
Convert double literals to model::DoubleType and model::IntType explicitly, because
otherwise clang produces a warning, that becomes an error in debug mode
  • Loading branch information
p-senichenkov committed Nov 29, 2024
1 parent 7593c0f commit cb7709c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/tests/test_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit cb7709c

Please sign in to comment.