[android][build] core tests - initial setup for rendering tests

This commit is contained in:
Ivo van Dongen
2016-06-23 16:39:27 +02:00
committed by Ivo van Dongen
parent 5ae92de618
commit c810d16f0d
15 changed files with 306 additions and 79 deletions

View File

@@ -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);