summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-03-09 10:54:27 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-03-09 11:23:24 +0000
commit1edd16879c238d36d75843be3b54bb20925eeedc (patch)
treefc001b3027830393f0e67da9de96ca985ad2d904 /tests
parent3fea1e53a14775a45e105efaf95066a8f1af5c18 (diff)
Fix building tests on QNX
Use qmath and cmath methods instead of math.h methods. Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp5
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp8
2 files changed, 4 insertions, 9 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index 1f5132d369..a192ccde59 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -48,6 +48,7 @@
#include <limits.h>
#include <float.h>
+#include <cmath>
#include <QLinkedList>
#include <QRegularExpression>
@@ -3376,10 +3377,10 @@ void tst_QVariant::numericalConvert()
switch (v.userType())
{
case QVariant::Double:
- QCOMPARE(v.toString() , QString::number(num, 'g', DBL_MANT_DIG * log10(2.) + 2));
+ QCOMPARE(v.toString() , QString::number(num, 'g', DBL_MANT_DIG * std::log10(2.) + 2));
break;
case QMetaType::Float:
- QCOMPARE(v.toString() , QString::number(float(num), 'g', FLT_MANT_DIG * log10(2.) + 2));
+ QCOMPARE(v.toString() , QString::number(float(num), 'g', FLT_MANT_DIG * std::log10(2.) + 2));
break;
}
}
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 4252561001..0a073f5c84 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -895,12 +895,6 @@ void tst_QPainterPath::operators()
QCOMPARE(test, expected);
}
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#define ANGLE(t) ((t) * 2 * M_PI / 360.0)
-
-
static inline bool pathFuzzyCompare(double p1, double p2)
{
return qAbs(p1 - p2) < 0.001;
@@ -931,7 +925,7 @@ void tst_QPainterPath::testArcMoveTo()
qreal y_radius = rect.height() / 2.0;
QPointF shouldBe = rect.center()
- + QPointF(x_radius * cos(ANGLE(angle)), -y_radius * sin(ANGLE(angle)));
+ + QPointF(x_radius * qCos(qDegreesToRadians(angle)), -y_radius * qSin(qDegreesToRadians(angle)));
qreal iw = 1 / rect.width();
qreal ih = 1 / rect.height();