diff options
author | Sergio Ahumada <sahumada@blackberry.com> | 2014-05-06 13:59:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-06 18:36:05 +0200 |
commit | 4603bf1bdcf20307398838e9435d18f1a4442983 (patch) | |
tree | afac6b5618cf2b045ce7c7e67cec6701109b4f7a | |
parent | d603bd03795b412fd7a20f4bd804e236560a90c6 (diff) | |
download | qtlocation-4603bf1bdcf20307398838e9435d18f1a4442983.tar.gz |
QNX: Fix compilation of tests
- replace ceil() -> std::ceil()
- replace floor() -> std::floor()
- replace pow() -> std::pow()
Change-Id: I102ec6748fceef02fadce1bc3e5bb37e7ebdcd9d
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp | 30 | ||||
-rw-r--r-- | tests/auto/qgeomapscene/tst_qgeomapscene.cpp | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp index 2aa55f49..c0722114 100644 --- a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp +++ b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp @@ -77,7 +77,7 @@ class tst_QGeoCameraTiles : public QObject private: void row(const PositionTestInfo &pti, int xOffset, int yOffset, int tileX, int tileY, int tileW, int tileH) { - double step = 1 / (pow(2.0, 4.0) * 4); + double step = 1 / (std::pow(2.0, 4.0) * 4); QString row = pti.xyString; row += QLatin1String(" - "); @@ -239,14 +239,14 @@ private slots: ct.setMaximumZoomLevel(8); ct.setTileSize(16); ct.setCamera(camera); - ct.setScreenSize(QSize(ceil(width), ceil(height))); + ct.setScreenSize(QSize(std::ceil(width), std::ceil(height))); QSet<QGeoTileSpec> tiles; QVERIFY2(tilesX.size() == tilesY.size(), "tilesX and tilesY have different size"); for (int i = 0; i < tilesX.size(); ++i) - tiles.insert(QGeoTileSpec("", 0, static_cast<int>(floor(zoom)), tilesX.at(i), tilesY.at(i))); + tiles.insert(QGeoTileSpec("", 0, static_cast<int>(std::floor(zoom)), tilesX.at(i), tilesY.at(i))); QCOMPARE(ct.tiles(), tiles); } @@ -556,8 +556,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; @@ -800,8 +800,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; @@ -1044,8 +1044,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; @@ -1287,8 +1287,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; @@ -1532,8 +1532,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; @@ -1776,8 +1776,8 @@ private slots: pti.zoom = 4.5; pti.zoomString = QLatin1String("frac zoom"); - pti.w = pti.w * pow(2.0, 0.5); - pti.h = pti.h * pow(2.0, 0.5); + pti.w = pti.w * std::pow(2.0, 0.5); + pti.h = pti.h * std::pow(2.0, 0.5); pti.x = 0.5; pti.y = 0.5; diff --git a/tests/auto/qgeomapscene/tst_qgeomapscene.cpp b/tests/auto/qgeomapscene/tst_qgeomapscene.cpp index 4303dd0f..a3b992dd 100644 --- a/tests/auto/qgeomapscene/tst_qgeomapscene.cpp +++ b/tests/auto/qgeomapscene/tst_qgeomapscene.cpp @@ -94,7 +94,7 @@ class tst_QGeoMapScene : public QObject double mercatorX; double mercatorY; - double halfLength = 1 / (pow(2.0, zoom) * 2); + double halfLength = 1 / (std::pow(2.0, zoom) * 2); double scaleX = screenWidth / tileSize; double scaleY = screenHeight / tileSize; double scaledHalfLengthX = halfLength * scaleX; |