summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Laing <david.laing@nokia.com>2012-03-16 15:03:30 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-20 05:42:53 +0100
commitf3174fa642f2ccd2c0cad9604878abf2d158aec4 (patch)
tree316c7da5cbb3a6d8c19cb3941362cf7e13f23f9c
parent908108424ad41425a257cfe2ad0d7c97f6822597 (diff)
downloadqtlocation-f3174fa642f2ccd2c0cad9604878abf2d158aec4.tar.gz
Coverity fixes, the sequel.
Change-Id: Icbe91d0f348e60a24599e2f93a719fafedf26708 Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
-rw-r--r--tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h2
-rw-r--r--tests/auto/geotestplugin/qgeotilefetcher_test.h23
-rw-r--r--tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp4
3 files changed, 17 insertions, 12 deletions
diff --git a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h
index 559266b8..9fccf9de 100644
--- a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h
+++ b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h
@@ -79,7 +79,7 @@ public:
setTileSize(QSize(256, 256));
QGeoTileFetcherTest *fetcher = new QGeoTileFetcherTest(this);
- fetcher->setParams(&parameters);
+ fetcher->setParams(parameters);
fetcher->setTileSize(QSize(256, 255));
setTileFetcher(fetcher);
}
diff --git a/tests/auto/geotestplugin/qgeotilefetcher_test.h b/tests/auto/geotestplugin/qgeotilefetcher_test.h
index 45788141..09337bad 100644
--- a/tests/auto/geotestplugin/qgeotilefetcher_test.h
+++ b/tests/auto/geotestplugin/qgeotilefetcher_test.h
@@ -55,6 +55,7 @@
#include <QTimer>
#include <QDebug>
#include <QTimerEvent>
+#include <QVariant>
QT_USE_NAMESPACE
@@ -79,12 +80,16 @@ class QGeoTileFetcherTest: public QGeoTileFetcher
Q_OBJECT
public:
QGeoTileFetcherTest(QGeoTiledMappingManagerEngine *engine, QObject *parent = 0)
- : QGeoTileFetcher(engine, parent) {}
+ : QGeoTileFetcher(engine, parent),
+ finishRequestImmediately_(false),
+ mappingReply_(0),
+ timerId_(0),
+ errorCode_(QGeoTiledMapReply::NoError) {}
bool init()
{
- if (m_parameters->contains("finishRequestImmediately"))
- finishRequestImmediately_ = qvariant_cast<bool>(m_parameters->value("finishRequestImmediately"));
+ if (parameters_.contains("finishRequestImmediately"))
+ finishRequestImmediately_ = parameters_.value("finishRequestImmediately").toBool();
return true;
}
@@ -123,17 +128,17 @@ public:
mappingReply_->callSetMapImageFormat("png");
mappingReply_->callSetFinished(true);
- return static_cast<QGeoTiledMapReply*>(mappingReply_);
+ return mappingReply_;
}
- void setParams(const QMap<QString, QVariant> *parameters)
+ void setParams(const QMap<QString, QVariant> &parameters)
{
- m_parameters = parameters;
+ parameters_ = parameters;
}
void setTileSize(QSize tileSize)
{
- m_tileSize = tileSize;
+ tileSize_ = tileSize;
}
public Q_SLOTS:
@@ -170,8 +175,8 @@ private:
int timerId_;
QGeoTiledMapReply::Error errorCode_;
QString errorString_;
- const QMap<QString, QVariant> *m_parameters;
- QSize m_tileSize;
+ QMap<QString, QVariant> parameters_;
+ QSize tileSize_;
};
#endif
diff --git a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
index cd988ae6..37d15d4a 100644
--- a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
+++ b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
@@ -324,7 +324,7 @@ void QDeclarativePinchGenerator::timerEvent(QTimerEvent *event)
Q_ASSERT(state_ == Replaying);
// Create touchevent. May have one or two touchpoints.
- QTouchEvent* touchEvent;
+ QTouchEvent* touchEvent = 0;
switch (swipes_.at(masterSwipe_)->touchPoints.at(replayBookmark_).state()) {
case (Qt::TouchPointPressed):
touchEvent = new QTouchEvent(QEvent::TouchBegin,NULL,Qt::NoModifier,Qt::TouchPointReleased);
@@ -337,7 +337,7 @@ void QDeclarativePinchGenerator::timerEvent(QTimerEvent *event)
break;
default:
Q_ASSERT(false);
- break;
+ return;
}
// Set touch points. Master swipe has touchpoints as it was chosen to have more touchpoints.
// For the other swipe we need to check.