summaryrefslogtreecommitdiff
path: root/test/map
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2016-06-23 16:39:27 +0200
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2016-11-27 18:50:24 +0200
commitc810d16f0d2787f15e06651ea595020415d5a8d5 (patch)
tree216b098897a887f5c1a8fff0aa78350e75445e52 /test/map
parent5ae92de618e5242f6a8a30485b5ecaa9ef0ebb5e (diff)
downloadqtlocation-mapboxgl-c810d16f0d2787f15e06651ea595020415d5a8d5.tar.gz
[android][build] core tests - initial setup for rendering tests
Diffstat (limited to 'test/map')
-rw-r--r--test/map/transform.test.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index 0cd92bfc2f..7f3a5e0556 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -109,7 +109,13 @@ TEST(Transform, IntegerZoom) {
auto checkIntegerZoom = [&transform](uint8_t zoomInt, double zoom) {
double scale = transform.getState().zoomScale(zoom);
transform.setScale(scale);
+#if __ANDROID__
+ // Android uses log(x) / M_LN2 instead of log2(x) because the latter
+ // is _broken in ARMv5 - that approach being less precise than log2(x).
+ ASSERT_NEAR(transform.getScale(), scale, 0.0001);
+#else
ASSERT_DOUBLE_EQ(transform.getScale(), scale);
+#endif
ASSERT_NEAR(transform.getZoom(), zoom, 0.0001);
ASSERT_EQ(transform.getState().getIntegerZoom(), zoomInt);
ASSERT_NEAR(transform.getState().getZoomFraction(), zoom - zoomInt, 0.0001);