Merge branch 'master' into jskia73
authorJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Wed, 31 Mar 2010 09:53:29 +0000 (12:53 +0300)
committerJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Wed, 31 Mar 2010 09:53:29 +0000 (12:53 +0300)
30 files changed:
doc/map/map_class_diagram.dia [new file with mode: 0644]
scripts/master_test_script.sh [new file with mode: 0755]
src/map/mapengine.cpp [new file with mode: 0644]
src/map/mapengine.h [new file with mode: 0644]
src/map/mapscene.cpp [new file with mode: 0644]
src/map/mapscene.h [new file with mode: 0644]
src/map/maptile.cpp [new file with mode: 0644]
src/map/maptile.h [new file with mode: 0644]
src/map/mapview.cpp [new file with mode: 0644]
src/map/mapview.h [new file with mode: 0644]
tests/testGPS/testGPS/testGPS.pro [new file with mode: 0644]
tests/testGPS/testGPS/testgps.cpp [new file with mode: 0755]
tests/testMap/testMapEngine/testMapEngine [new file with mode: 0755]
tests/testMap/testMapEngine/testMapEngine.pro [new file with mode: 0644]
tests/testMap/testMapEngine/testmapengine.cpp [new file with mode: 0644]
tests/testMap/testMapScene/testMapScene [new file with mode: 0755]
tests/testMap/testMapScene/testMapScene.pro [new file with mode: 0644]
tests/testMap/testMapScene/testmapscene.cpp [new file with mode: 0644]
tests/testMap/testMapTile/testMapTile [new file with mode: 0755]
tests/testMap/testMapTile/testMapTile.pro [new file with mode: 0644]
tests/testMap/testMapTile/testmaptile.cpp [new file with mode: 0644]
tests/testMap/testMapView/testMapView [new file with mode: 0755]
tests/testMap/testMapView/testMapView.pro [new file with mode: 0644]
tests/testMap/testMapView/testmapview.cpp [new file with mode: 0644]
tests/testPHP/testPHP/testPHP.pro [new file with mode: 0644]
tests/testPHP/testPHP/testphp.cpp [new file with mode: 0755]
tests/testUI/testUI.pro [deleted file]
tests/testUI/testUI/testUI.pro [new file with mode: 0644]
tests/testUI/testUI/testui.cpp [new file with mode: 0755]
tests/testUI/testui.cpp [deleted file]

diff --git a/doc/map/map_class_diagram.dia b/doc/map/map_class_diagram.dia
new file mode 100644 (file)
index 0000000..45f962b
Binary files /dev/null and b/doc/map/map_class_diagram.dia differ
diff --git a/scripts/master_test_script.sh b/scripts/master_test_script.sh
new file mode 100755 (executable)
index 0000000..781cfe0
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+##########################################################
+# This script is executed from /scripts directory        #
+# in situare project folder                              #
+##########################################################
+clear
+echo "This is the master script for building and executing all automatic unit test."
+echo "As a final step, it creates summary report from all tests executed."
+##########################################################
+#Environment settings                                   #
+##########################################################
+#Store all directory names to a list
+MODULES=(`ls ../tests/`)
+#Modify this path to point to correct path
+location=$HOME/situare/repository/situare/tests/
+FILE=$HOME/situare/repository/situare/scripts/tests_summary.txt
+if [ ! -e $FILE ]; then
+    touch tests_summary.txt
+    echo "##########################################" >> tests_summary.txt
+    echo "# Summary of unit tests executed         #" >> tests_summary.txt
+    echo "# Date: `date`    #" >> tests_summary.txt
+    echo "# User: `whoami`                            #" >> tests_summary.txt
+    echo "##########################################" >> tests_summary.txt
+fi  
+
+##########################################################
+#First part: Execution of all tests                      #
+##########################################################
+for component in "${MODULES[@]}" #Loop through components
+do
+  cd $location/$component
+  CASES=(`ls`) #List all test cases uner component directory
+  for unittest in "${CASES[@]}"
+  do
+    cd $location/$component/$unittest
+    if [ $component = "testMap" ]; then 
+       qmake
+    else 
+       qmake -project "CONFIG+=qtestlib"
+       echo "Creating make file for $component/$unittest"
+       qmake
+    fi
+    echo "Building tests for $component/$unittest"
+    make
+    echo "Running tests for $component/$unittest"
+    ./$unittest -o testreport_$component.txt
+    echo "Cleaning $unittest"
+    make clean
+    rm Makefile
+    rm $unittest
+  done
+done
+
+#########################################################
+# Second part: Extraction of results                   #
+#########################################################
+echo "Summarizing test results....." 
+for component in "${MODULES[@]}" #Loop through components
+do 
+  cd $location/$component
+  CASES=(`ls`) #List all test cases uner component directory
+  for unittests in "${CASES[@]}"
+  do
+    cd $location/$component/$unittests
+    echo "############# $component/$unittests ################" >> $FILE
+    grep Totals *.txt >> $FILE
+  done
+done
+exit 0
diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp
new file mode 100644 (file)
index 0000000..0e91fbe
--- /dev/null
@@ -0,0 +1,57 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <math.h>
+
+#include "mapengine.h"
+#include "maptile.h"
+
+MapEngine::MapEngine()
+{
+}
+
+MapEngine::MapEngine(MapView *mapView)
+{
+//    m_mapView = mapView;
+//    m_mapScene = new MapScene();
+//    mapView->setScene(m_mapScene);
+//
+//    /// \todo remove debug data
+//    for (int x=4261; x<=4264; x++) {
+//        for (int y=9352; y<=9353; y++) {
+//            MapTile *mapTile = new MapTile();
+//            mapTile->setZoomLevel(14);
+//            mapTile->setTileXY(x, y);
+//            mapTile->setPixmap(QPixmap("/home/ramosam-local/situare/src/map/static_test_tiles/14_9352_4261.png"));
+//            mapTile->setOffset((x-4261)*256, (y-9352)*256);
+//            m_mapScene->addMapTile(mapTile);
+//        }
+//    }
+}
+
+QPoint MapEngine::convertTileNumberToSceneCoordinate(int zoomLevel, QPoint tileNumber)
+{
+    int x = tileNumber.x() * TILE_SIZE_X * pow(2, MAX_ZOOM_LEVEL - zoomLevel);
+    int y = tileNumber.y() * TILE_SIZE_Y * pow(2, MAX_ZOOM_LEVEL - zoomLevel);
+
+    return QPoint(x, y);
+}
diff --git a/src/map/mapengine.h b/src/map/mapengine.h
new file mode 100644 (file)
index 0000000..85c8ff0
--- /dev/null
@@ -0,0 +1,47 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#ifndef MAPENGINE_H
+#define MAPENGINE_H
+
+#include "mapview.h"
+#include "mapscene.h"
+
+class MapEngine
+{
+public:
+    MapEngine();
+    MapEngine(MapView *mapView);
+    QPoint convertTileNumberToSceneCoordinate(int zoomLevel, QPoint tileNumber);
+
+public:
+    static const int TILE_SIZE_X = 256;
+    static const int TILE_SIZE_Y = 256;
+    static const int MAX_ZOOM_LEVEL = 18;
+
+private:
+    MapView *m_mapView;
+    MapScene *m_mapScene;
+};
+
+#endif // MAPENGINE_H
diff --git a/src/map/mapscene.cpp b/src/map/mapscene.cpp
new file mode 100644 (file)
index 0000000..385fa65
--- /dev/null
@@ -0,0 +1,36 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#include "mapscene.h"
+
+MapScene::MapScene(QObject *parent) : QGraphicsScene(parent)
+{
+}
+
+void MapScene::addMapTile(MapTile *mapTile)
+{
+//    /// \todo set offset & transfor (=zoom)
+//    mapTile->setOffset(x, y);
+//    //mapTile->setTransform();
+//    addItem(mapTile);
+}
diff --git a/src/map/mapscene.h b/src/map/mapscene.h
new file mode 100644 (file)
index 0000000..67dfdfc
--- /dev/null
@@ -0,0 +1,40 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#ifndef MAPSCENE_H
+#define MAPSCENE_H
+
+#include <QGraphicsScene>
+
+#include "map/maptile.h"
+
+
+class MapScene : public QGraphicsScene
+{
+public:
+
+    MapScene(QObject *parent = 0);
+    void addMapTile(MapTile *mapTile);
+};
+
+#endif // MAPSCENE_H
diff --git a/src/map/maptile.cpp b/src/map/maptile.cpp
new file mode 100644 (file)
index 0000000..8232075
--- /dev/null
@@ -0,0 +1,48 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#include "maptile.h"
+
+MapTile::MapTile()
+{
+}
+
+quint8 MapTile::zoomLevel()
+{
+    return m_zoomLevel;
+}
+
+void MapTile::setZoomLevel(quint8 zoomLevel)
+{
+    m_zoomLevel = zoomLevel;
+}
+
+QPoint MapTile::tileNumber()
+{
+    return m_tileNumber;
+}
+
+void MapTile::setTileNumber(QPoint tileNumber)
+{
+    m_tileNumber = tileNumber;
+}
diff --git a/src/map/maptile.h b/src/map/maptile.h
new file mode 100644 (file)
index 0000000..ca04793
--- /dev/null
@@ -0,0 +1,44 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#ifndef MAPTILE_H
+#define MAPTILE_H
+
+#include <QGraphicsPixmapItem>
+#include <QPoint>
+
+class MapTile : public QGraphicsPixmapItem
+{
+public:
+    MapTile();
+    quint8 zoomLevel();
+    void setZoomLevel(quint8 zoomLevel);
+    QPoint tileNumber();
+    void setTileNumber(QPoint tileNumber);
+
+private:
+    quint32 m_zoomLevel;
+    QPoint m_tileNumber;
+};
+
+#endif // MAPTILE_H
diff --git a/src/map/mapview.cpp b/src/map/mapview.cpp
new file mode 100644 (file)
index 0000000..7da7ef7
--- /dev/null
@@ -0,0 +1,30 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#include "mapview.h"
+
+MapView::MapView(QWidget *parent) : QGraphicsView(parent)
+{
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+}
diff --git a/src/map/mapview.h b/src/map/mapview.h
new file mode 100644 (file)
index 0000000..2a2eb36
--- /dev/null
@@ -0,0 +1,35 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Sami Rämö - sami.ramo@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#ifndef MAPVIEW_H
+#define MAPVIEW_H
+
+#include <QGraphicsView>
+
+class MapView : public QGraphicsView
+{
+public:
+    MapView(QWidget *parent = 0);
+};
+
+#endif // MAPVIEW_H
diff --git a/tests/testGPS/testGPS/testGPS.pro b/tests/testGPS/testGPS/testGPS.pro
new file mode 100644 (file)
index 0000000..cd149c3
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 14:23:01 2010
+######################################################################
+
+CONFIG+=qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += ../../../src/ui/mainwindow.h
+SOURCES += testgps.cpp ../../../src/ui/mainwindow.cpp
diff --git a/tests/testGPS/testGPS/testgps.cpp b/tests/testGPS/testGPS/testgps.cpp
new file mode 100755 (executable)
index 0000000..7b431c5
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Henri Lampela - henri.lampela@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include "../../../src/ui/mainwindow.h"
+
+class TestGps: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void testGps();
+
+
+};
+
+void TestGps::testGps()
+{
+    QLineEdit lineEdit;
+
+    QTest::keyClicks(&lineEdit, "UI test");
+
+    QCOMPARE(lineEdit.text(), QString("UI test"));
+}
+
+
+QTEST_MAIN(TestGps)
+#include "testgps.moc"
diff --git a/tests/testMap/testMapEngine/testMapEngine b/tests/testMap/testMapEngine/testMapEngine
new file mode 100755 (executable)
index 0000000..6e76cc0
Binary files /dev/null and b/tests/testMap/testMapEngine/testMapEngine differ
diff --git a/tests/testMap/testMapEngine/testMapEngine.pro b/tests/testMap/testMapEngine/testMapEngine.pro
new file mode 100644 (file)
index 0000000..fd155bd
--- /dev/null
@@ -0,0 +1,14 @@
+# #####################################################################
+# Automatically generated by qmake (2.01a) Fri Mar 26 15:09:16 2010
+# #####################################################################
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+# Input
+SOURCES += testmapengine.cpp \
+    ../../../src/map/mapengine.cpp
+HEADERS += ../../../src/map/mapengine.h
diff --git a/tests/testMap/testMapEngine/testmapengine.cpp b/tests/testMap/testMapEngine/testmapengine.cpp
new file mode 100644 (file)
index 0000000..a19dcbc
--- /dev/null
@@ -0,0 +1,22 @@
+#include <QtTest/QtTest>
+
+#include "map/mapengine.h"
+
+class TestMapEngine: public QObject
+{
+    Q_OBJECT
+private slots:
+    void convertTileNumberToSceneCoordinate();
+};
+
+void TestMapEngine::convertTileNumberToSceneCoordinate()
+{
+    MapEngine mapEngine;
+
+    QCOMPARE(mapEngine.convertTileNumberToSceneCoordinate(18, QPoint(0,0)), QPoint(0,0));
+    QCOMPARE(mapEngine.convertTileNumberToSceneCoordinate(18, QPoint(1,2)), QPoint(256,512));
+    QCOMPARE(mapEngine.convertTileNumberToSceneCoordinate(16, QPoint(3,4)), QPoint(3072,4096));
+}
+
+QTEST_MAIN(TestMapEngine)
+#include "testmapengine.moc"
diff --git a/tests/testMap/testMapScene/testMapScene b/tests/testMap/testMapScene/testMapScene
new file mode 100755 (executable)
index 0000000..ee4b55f
Binary files /dev/null and b/tests/testMap/testMapScene/testMapScene differ
diff --git a/tests/testMap/testMapScene/testMapScene.pro b/tests/testMap/testMapScene/testMapScene.pro
new file mode 100644 (file)
index 0000000..1ec24d9
--- /dev/null
@@ -0,0 +1,16 @@
+# #####################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 10:06:28 2010
+# #####################################################################
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+# Input
+SOURCES += testmapscene.cpp \
+    ../../../src/map/mapscene.cpp \
+    ../../../src/map/maptile.cpp
+HEADERS += ../../../src/map/mapscene.h \
+    ../../../src/map/maptile.h
diff --git a/tests/testMap/testMapScene/testmapscene.cpp b/tests/testMap/testMapScene/testmapscene.cpp
new file mode 100644 (file)
index 0000000..8abdfc1
--- /dev/null
@@ -0,0 +1,27 @@
+#include <QtTest/QtTest>
+
+#include "map/mapscene.h"
+#include "map/maptile.h"
+
+class TestMapScene : public QObject
+{
+    Q_OBJECT
+private slots:
+    void addMapTile();
+};
+
+void TestMapScene::addMapTile()
+{
+    MapScene mapScene;
+
+    MapTile mapTile;
+    mapTile.setZoomLevel(18);
+    mapTile.setTileNumber(QPoint(12, 47));
+
+    mapScene.addMapTile(&mapTile);
+
+    QVERIFY(mapTile.zoomLevel() == 13);
+}
+
+QTEST_MAIN(TestMapScene)
+#include "testmapscene.moc"
diff --git a/tests/testMap/testMapTile/testMapTile b/tests/testMap/testMapTile/testMapTile
new file mode 100755 (executable)
index 0000000..92a172a
Binary files /dev/null and b/tests/testMap/testMapTile/testMapTile differ
diff --git a/tests/testMap/testMapTile/testMapTile.pro b/tests/testMap/testMapTile/testMapTile.pro
new file mode 100644 (file)
index 0000000..70c9a69
--- /dev/null
@@ -0,0 +1,14 @@
+# #####################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 10:06:28 2010
+# #####################################################################
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+# Input
+SOURCES += testmaptile.cpp \
+    ../../../src/map/maptile.cpp
+HEADERS += ../../../src/map/maptile.h
diff --git a/tests/testMap/testMapTile/testmaptile.cpp b/tests/testMap/testMapTile/testmaptile.cpp
new file mode 100644 (file)
index 0000000..d875c67
--- /dev/null
@@ -0,0 +1,28 @@
+#include <QtTest/QtTest>
+
+#include "map/maptile.h"
+
+class TestMapTile : public QObject
+{
+    Q_OBJECT
+private slots:
+    void zoomLevel();
+    void tileNumber();
+};
+
+void TestMapTile::zoomLevel()
+{
+    MapTile mapTile;
+    mapTile.setZoomLevel(13);
+    QVERIFY(mapTile.zoomLevel() == 13);
+}
+
+void TestMapTile::tileNumber()
+{
+    MapTile mapTile;
+    mapTile.setTileNumber(QPoint(24, 17));
+    QVERIFY(mapTile.tileNumber() == QPoint(24, 17));
+}
+
+QTEST_MAIN(TestMapTile)
+#include "testmaptile.moc"
diff --git a/tests/testMap/testMapView/testMapView b/tests/testMap/testMapView/testMapView
new file mode 100755 (executable)
index 0000000..a1d221c
Binary files /dev/null and b/tests/testMap/testMapView/testMapView differ
diff --git a/tests/testMap/testMapView/testMapView.pro b/tests/testMap/testMapView/testMapView.pro
new file mode 100644 (file)
index 0000000..fbd09d9
--- /dev/null
@@ -0,0 +1,14 @@
+# #####################################################################
+# Automatically generated by qmake (2.01a) Fri Mar 26 15:22:56 2010
+# #####################################################################
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+# Input
+SOURCES += testmapview.cpp \
+    ../../../src/map/mapview.cpp
+HEADERS += ../../../src/map/mapview.h
diff --git a/tests/testMap/testMapView/testmapview.cpp b/tests/testMap/testMapView/testmapview.cpp
new file mode 100644 (file)
index 0000000..7cfb174
--- /dev/null
@@ -0,0 +1,18 @@
+#include <QtTest/QtTest>
+
+#include "map/mapview.h"
+
+class TestMapView: public QObject
+{
+    Q_OBJECT
+private slots:
+    void dummyTestCase();
+};
+
+void TestMapView::dummyTestCase()
+{
+    QVERIFY(true);
+}
+
+QTEST_MAIN(TestMapView)
+#include "testmapview.moc"
diff --git a/tests/testPHP/testPHP/testPHP.pro b/tests/testPHP/testPHP/testPHP.pro
new file mode 100644 (file)
index 0000000..915da3a
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 14:23:19 2010
+######################################################################
+
+CONFIG+=qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += ../../../src/ui/mainwindow.h
+SOURCES += testphp.cpp ../../../src/ui/mainwindow.cpp
diff --git a/tests/testPHP/testPHP/testphp.cpp b/tests/testPHP/testPHP/testphp.cpp
new file mode 100755 (executable)
index 0000000..84af3b0
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Henri Lampela - henri.lampela@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include "../../../src/ui/mainwindow.h"
+
+class TestPhp: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void testPhp();
+
+
+};
+
+void TestPhp::testPhp()
+{
+    QLineEdit lineEdit;
+
+    QTest::keyClicks(&lineEdit, "UI test");
+
+    QCOMPARE(lineEdit.text(), QString("UI test"));
+}
+
+
+QTEST_MAIN(TestPhp)
+#include "testphp.moc"
diff --git a/tests/testUI/testUI.pro b/tests/testUI/testUI.pro
deleted file mode 100644 (file)
index 405e8f4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Fri Mar 26 11:22:18 2010
-######################################################################
-
-CONFIG += qtestlib
-TEMPLATE = app
-TARGET = 
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-HEADERS += ../../src/ui/mainwindow.h testui.moc
-SOURCES += testui.cpp ../../src/ui/mainwindow.cpp
diff --git a/tests/testUI/testUI/testUI.pro b/tests/testUI/testUI/testUI.pro
new file mode 100644 (file)
index 0000000..c516a6b
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 14:23:24 2010
+######################################################################
+
+CONFIG+=qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += ../../../src/ui/mainwindow.h
+SOURCES += testui.cpp ../../../src/ui/mainwindow.cpp
diff --git a/tests/testUI/testUI/testui.cpp b/tests/testUI/testUI/testui.cpp
new file mode 100755 (executable)
index 0000000..da311e6
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Henri Lampela - henri.lampela@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include "../../../src/ui/mainwindow.h"
+
+class TestUi: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void testUi();
+
+
+};
+
+void TestUi::testUi()
+{
+    QLineEdit lineEdit;
+
+    QTest::keyClicks(&lineEdit, "UI tests");
+
+    QCOMPARE(lineEdit.text(), QString("UI test"));
+}
+
+
+QTEST_MAIN(TestUi)
+#include "testui.moc"
diff --git a/tests/testUI/testui.cpp b/tests/testUI/testui.cpp
deleted file mode 100755 (executable)
index 651ee5d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-    Situare - A location system for Facebook
-    Copyright (C) 2010  Ixonos Plc. Authors:
-
-       Henri Lampela - henri.lampela@ixonos.com
-
-    Situare is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    version 2 as published by the Free Software Foundation.
-
-    Situare is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with Situare; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-    USA.
- */
-
-#include <QtGui>
-#include <QtTest/QtTest>
-#include "../../src/ui/mainwindow.h"
-
-class TestUi: public QObject
-{
-    Q_OBJECT
-
-private slots:
-    void testUi();
-
-
-};
-
-void TestUi::testUi()
-{
-    QLineEdit lineEdit;
-
-    QTest::keyClicks(&lineEdit, "UI test");
-
-    QCOMPARE(lineEdit.text(), QString("UI test"));
-}
-
-
-QTEST_MAIN(TestUi)
-#include "testui.moc"