Updated unit tests
authorSami Rämö <sami.ramo@ixonos.com>
Fri, 30 Apr 2010 09:09:59 +0000 (12:09 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Fri, 30 Apr 2010 09:09:59 +0000 (12:09 +0300)
tests/map/mapengine/testmapengine.pro
tests/map/mapscene/testmapscene.cpp
tests/map/mapscene/testmapscene.pro
tests/map/maptile/testmaptile.cpp
tests/map/maptile/testmaptile.pro

index 8ec760c..897ff16 100644 (file)
@@ -8,27 +8,28 @@ TARGET =
 DEPENDPATH += .
 INCLUDEPATH += . \
     ../../../src/
-#DEFINES += QT_NO_DEBUG_OUTPUT
 
+# DEFINES += QT_NO_DEBUG_OUTPUT
 # Input
 SOURCES += testmapengine.cpp \
     ../../../src/map/mapengine.cpp \
     ../../../src/map/mapscene.cpp \
     ../../../src/map/maptile.cpp \
     ../../../src/map/mapview.cpp \
-    ../../../src/map/mapfetcher.cpp
+    ../../../src/map/mapfetcher.cpp \
+    ../../../src/map/mapzoompanel.cpp \
+    ../../../src/map/mapbutton.cpp \
+    ../../../src/map/ownlocationitem.cpp
 HEADERS += ../../../src/map/mapengine.h \
     ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
     ../../../src/map/mapview.h \
     ../../../src/map/mapfetcher.h \
-    ../../../src/common.h
+    ../../../src/common.h \
+    ../../../src/map/mapzoompanel.h \
+    ../../../src/map/mapbutton.h \
+    ../../../src/map/ownlocationitem.h
 RESOURCES += 
 
-# use don't use OpenGL when building in scratchbox
-!maemo5 {
-    QT += opengl
-    message(OpenGL built in)
-    message(Make sure you have OpenGL development headers installed)
-    message(install headers with: sudo apt-get install libgl-dev libglu-dev)
-}
+DEFINES += QT_NO_DEBUG_OUTPUT
+
index 3159d9f..40539bf 100644 (file)
@@ -47,11 +47,11 @@ void TestMapScene::addMapTile()
     // Top-left corner x = 256, y = 512
     // Bottom-right corner x + 255, y + 255
     MapTile *mapTile = new MapTile();
-    mapTile->setZoomLevel(18);
+    mapTile->setZoomLevel(18, 14);
     mapTile->setTileNumber(QPoint(1, 2));
     mapTile->setPixmap(QPixmap("maptile.png"));
 
-    mapScene.addMapTile(mapTile);
+    mapScene.addTile(mapTile, "dymmyTestKey");
 
     // Check around top-left and bottom-right corners
     int x = 256;
@@ -68,7 +68,7 @@ void TestMapScene::addMapTile()
     // Zoom level is 16, so stretching is also tested
     // Top-left corner x = 2048, y = 3072
     // Bottom-right corner x + 1023, y + 1023
-    mapTile->setZoomLevel(16);
+    mapTile->setZoomLevel(16, 14);
     mapTile->setTileNumber(QPoint(2, 3));
 
     // Check around top-left and bottom-right corners
index 0058538..da1b7a5 100644 (file)
@@ -14,8 +14,16 @@ SOURCES += testmapscene.cpp \
     ../../../src/map/mapscene.cpp \
     ../../../src/map/maptile.cpp \
     ../../../src/map/mapengine.cpp \
-    ../../../src/map/mapfetcher.cpp
+    ../../../src/map/mapfetcher.cpp \
+    ../../../src/map/mapzoompanel.cpp \
+    ../../../src/map/mapbutton.cpp \
+    ../../../src/map/ownlocationitem.cpp
 HEADERS += ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
     ../../../src/map/mapengine.h \
-    ../../../src/map/mapfetcher.h
+    ../../../src/map/mapfetcher.h \
+    ../../../src/map/mapzoompanel.h \
+    ../../../src/map/mapbutton.h \
+    ../../../src/map/ownlocationitem.h
+
+DEFINES += QT_NO_DEBUG_OUTPUT
index c6676f4..3d44fd3 100644 (file)
@@ -42,7 +42,7 @@ private slots:
 void TestMapTile::zoomLevel()
 {
     MapTile mapTile;
-    mapTile.setZoomLevel(13);
+    mapTile.setZoomLevel(13, 14);
     QVERIFY(mapTile.zoomLevel() == 13);
 
 }
@@ -93,7 +93,7 @@ void TestMapTile::position()
     QFETCH(QPointF, result);
 
     MapTile mapTile;
-    mapTile.setZoomLevel(zoomLevel);
+    mapTile.setZoomLevel(zoomLevel, 14);
     mapTile.setTileNumber(tileNumber);
     QCOMPARE(mapTile.pos(), result);
 }
@@ -113,12 +113,12 @@ void TestMapTile::positionUnsetValues()
     QCOMPARE(mapTile.pos(), QPointF(-1, -1));
 
     // both set
-    mapTile.setZoomLevel(16);
+    mapTile.setZoomLevel(16, 14);
     QCOMPARE(mapTile.pos(), QPointF(24576, 17408));
 
     // only zoom level set
     MapTile anotherMapTile;
-    anotherMapTile.setZoomLevel(14);
+    anotherMapTile.setZoomLevel(14, 14);
     QCOMPARE(anotherMapTile.pos(), QPointF(-1, -1));
 }
 
@@ -151,7 +151,7 @@ void TestMapTile::sceneLevel()
     QFETCH(qreal, result);
 
     MapTile tile;
-    tile.setZoomLevel(tileZoomLevel);
+    tile.setZoomLevel(tileZoomLevel, 14);
     tile.setSceneLevel(viewZoomLevel);
     QCOMPARE(tile.zValue(), result);
 }
index 5b54264..37bb9fd 100644 (file)
@@ -14,8 +14,16 @@ SOURCES += testmaptile.cpp \
     ../../../src/map/maptile.cpp \
     ../../../src/map/mapfetcher.cpp \
     ../../../src/map/mapengine.cpp \
-    ../../../src/map/mapscene.cpp
+    ../../../src/map/mapscene.cpp \
+    ../../../src/map/ownlocationitem.cpp \
+    ../../../src/map/mapzoompanel.cpp \
+    ../../../src/map/mapbutton.cpp
 HEADERS += ../../../src/map/maptile.h \
     ../../../src/map/mapfetcher.h \
     ../../../src/map/mapengine.h \
-    ../../../src/map/mapscene.h
+    ../../../src/map/mapscene.h \
+    ../../../src/map/ownlocationitem.h \
+    ../../../src/map/mapzoompanel.h \
+    ../../../src/map/mapbutton.h
+
+DEFINES += QT_NO_DEBUG_OUTPUT