Skip to content

Commit fba61f5

Browse files
committed
std::abs -> abs
1 parent c24332b commit fba61f5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/modm/math/saturation/saturation_test.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ SaturationTest::testSigned8bit()
6868
TEST_ASSERT_EQUALS(x.getValue(), -10);
6969

7070
y = -100;
71-
/* x = std::abs(y);
72-
TEST_ASSERT_EQUALS(x.getValue(), 100); */
71+
x = abs(y);
72+
TEST_ASSERT_EQUALS(x.getValue(), 100);
7373

7474
x = y;
7575
x.absolute();
@@ -133,7 +133,7 @@ SaturationTest::testUnsigned8bit()
133133
TEST_ASSERT_EQUALS(x.getValue(), 0U);
134134

135135
y = 200;
136-
x = std::abs(y);
136+
x = abs(y);
137137
TEST_ASSERT_EQUALS(x.getValue(), 200U);
138138

139139
x = y;
@@ -193,7 +193,7 @@ SaturationTest::testSigned16bit()
193193
TEST_ASSERT_EQUALS(x.getValue(), 10000);
194194

195195
y = -20000;
196-
x = std::abs(y);
196+
x = abs(y);
197197
TEST_ASSERT_EQUALS(x.getValue(), 20000);
198198

199199
x = y;
@@ -257,9 +257,8 @@ SaturationTest::testUnsigned16bit()
257257
TEST_ASSERT_EQUALS(x.getValue(), 0U);
258258

259259
y = 20000;
260-
// FIXME Fails on AVR ATmega: ambigious overload
261-
/* x = std::abs(y);
262-
TEST_ASSERT_EQUALS(x.getValue(), 20000); */
260+
x = abs(y);
261+
TEST_ASSERT_EQUALS(x.getValue(), 20000);
263262

264263
x = y;
265264
x.absolute();

0 commit comments

Comments
 (0)