From acbe469322d0ab4aac863192ca5bf6fe1feedaed Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Nov 2011 08:46:23 +0100 Subject: QtSensors: Fix compilation of examples/warnings on Windows. - Fix double->float truncation in tests - Use -rdynamic for g++ only - Introduce EXPORT macro in grue library for Windows to work - Add DESTDIR for the grue lib (to prevent it from ending up in the debug/release subfolders, respectively Change-Id: I3b902b501483c92639c0a6252240db4ed8a4a00d Sanity-Review: Qt Sanity Bot Reviewed-by: Lincoln Ramsay --- tests/auto/sensors2qmlapi/qdeclaccelerometer.h | 8 ++++---- tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/sensors2qmlapi/qdeclaccelerometer.h b/tests/auto/sensors2qmlapi/qdeclaccelerometer.h index 5d8da9fb..01b8ea68 100644 --- a/tests/auto/sensors2qmlapi/qdeclaccelerometer.h +++ b/tests/auto/sensors2qmlapi/qdeclaccelerometer.h @@ -65,13 +65,13 @@ public: } bool isActive() { return _active; } - void test(float x, float y, float z) + void test(qreal x, qreal y, qreal z) { if (sensor()->filters().count() > 0){ QAccelerometerFilter* af = (QAccelerometerFilter*)sensor()->filters().at(0); - reader.setX((qreal)x); - reader.setY((qreal)y); - reader.setZ((qreal)z); + reader.setX(x); + reader.setY(y); + reader.setZ(z); af->filter(&reader); } } diff --git a/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp b/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp index 6c1e085b..2e438fd5 100644 --- a/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp +++ b/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp @@ -404,8 +404,8 @@ void tst_Sensors2QMLAPI::testTiltUnit() _tilt->setProperty("accuracy", 0.0); _tilt->setProperty("unit", QVariant(QSensor2Tilt::Radians)); accel->test(-3.59904, 5.52114, 7.07059); - float xRotation = _tilt->property("xRotation").toFloat(); - float yRotation = _tilt->property("yRotation").toFloat(); + qreal xRotation = _tilt->property("xRotation").toReal(); + qreal yRotation = _tilt->property("yRotation").toReal(); xRotation += 0.159136; yRotation -= 0.43440; QVERIFY(xRotation < 0.0001); @@ -414,8 +414,8 @@ void tst_Sensors2QMLAPI::testTiltUnit() _tilt->setProperty("unit", QVariant(QSensor2Tilt::Degrees)); accel->test(-3.59904, 5.52114, 7.07059); - xRotation = _tilt->property("xRotation").toFloat(); - yRotation = _tilt->property("yRotation").toFloat(); + xRotation = _tilt->property("xRotation").toReal(); + yRotation = _tilt->property("yRotation").toReal(); xRotation += 9.11778; yRotation -= 24.8898; QVERIFY(xRotation < 0.0001); -- cgit v1.2.3