Cleanup of test cases
authorJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Thu, 15 Apr 2010 09:49:24 +0000 (12:49 +0300)
committerJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Thu, 15 Apr 2010 09:49:24 +0000 (12:49 +0300)
tests/testui/testpixmap/dummy_personal_infotab_background.png [deleted file]
tests/testui/testpixmap/testpixmap.cpp [deleted file]
tests/testui/testpixmap/testpixmap.pro [deleted file]
tests/ui/pixmap/dummy_personal_infotab_background.png [new file with mode: 0644]
tests/ui/pixmap/testpixmap.cpp [new file with mode: 0644]
tests/ui/pixmap/testpixmap.pro [new file with mode: 0644]

diff --git a/tests/testui/testpixmap/dummy_personal_infotab_background.png b/tests/testui/testpixmap/dummy_personal_infotab_background.png
deleted file mode 100644 (file)
index 08dca9d..0000000
Binary files a/tests/testui/testpixmap/dummy_personal_infotab_background.png and /dev/null differ
diff --git a/tests/testui/testpixmap/testpixmap.cpp b/tests/testui/testpixmap/testpixmap.cpp
deleted file mode 100644 (file)
index 1b85356..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-     Situare - A location system for Facebook
-     Copyright (C) 2010  Ixonos Plc. Authors:
-
-         Jukka Saastamoinen - jukka.saastamoinen@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 <QtTest>
-#include <QtGui>
-#include "ui/pixmap.h"
-
-
-class TestPixmap: public QObject
-{
-    Q_OBJECT
-private slots:
-    void constructorTest();
-    void boundingRegionTest();
-private:
-    bool pixelCompareImages( const QImage &a, const QImage &b );
-};
-
-/**
-* @brief Tests that the class accepts the png file used to draw the image
-*/
-void TestPixmap::constructorTest()
-{
-    Pixmap *infoTab = new Pixmap(QPixmap("dummy_personal_infotab_background.png"));
-    delete infoTab;
-    infoTab=NULL;
-    QVERIFY(!infoTab);
-}
-
-/**
-* @brief Tests that the bounding area reserved for the picture is the same as
-* the picture size.
-*/
-
-void TestPixmap::boundingRegionTest()
-{
-    Pixmap testPic(QPixmap("dummy_personal_infotab_background.png")); //350x300 pix
-    QPixmap refPic("dummy_personal_infotab_background.png");
-    QRectF boundArea = testPic.boundingRect();
-    QRectF refArea;
-    refArea.setSize(refPic.size());
-    QVERIFY(boundArea.size()==refArea.size());
-}
-
-bool TestPixmap::pixelCompareImages( const QImage &a, const QImage &b )
-{
-  if( a.size() != b.size() )
-    return false;
-
-  if( a.format() != b.format() )
-    return false;
-
-  for( int x=0; x<a.width(); ++x )
-    for( int y=0; y<a.height(); ++y )
-      if( a.pixel(x,y) != b.pixel(x,y) )
-        return false;
-
-  return true;
-}
-
-QTEST_MAIN(TestPixmap)
-#include "testpixmap.moc"
-
-
diff --git a/tests/testui/testpixmap/testpixmap.pro b/tests/testui/testpixmap/testpixmap.pro
deleted file mode 100644 (file)
index 4eaec95..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIG += qtestlib
-TEMPLATE = app
-TARGET = 
-DEPENDPATH += .
-INCLUDEPATH += . \
-    ../../../src/
-
-SOURCES += testpixmap.cpp \
-       ../../../src/ui/pixmap.cpp
-HEADERS += ../../../src/ui/pixmap.h
diff --git a/tests/ui/pixmap/dummy_personal_infotab_background.png b/tests/ui/pixmap/dummy_personal_infotab_background.png
new file mode 100644 (file)
index 0000000..08dca9d
Binary files /dev/null and b/tests/ui/pixmap/dummy_personal_infotab_background.png differ
diff --git a/tests/ui/pixmap/testpixmap.cpp b/tests/ui/pixmap/testpixmap.cpp
new file mode 100644 (file)
index 0000000..1b85356
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+     Situare - A location system for Facebook
+     Copyright (C) 2010  Ixonos Plc. Authors:
+
+         Jukka Saastamoinen - jukka.saastamoinen@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 <QtTest>
+#include <QtGui>
+#include "ui/pixmap.h"
+
+
+class TestPixmap: public QObject
+{
+    Q_OBJECT
+private slots:
+    void constructorTest();
+    void boundingRegionTest();
+private:
+    bool pixelCompareImages( const QImage &a, const QImage &b );
+};
+
+/**
+* @brief Tests that the class accepts the png file used to draw the image
+*/
+void TestPixmap::constructorTest()
+{
+    Pixmap *infoTab = new Pixmap(QPixmap("dummy_personal_infotab_background.png"));
+    delete infoTab;
+    infoTab=NULL;
+    QVERIFY(!infoTab);
+}
+
+/**
+* @brief Tests that the bounding area reserved for the picture is the same as
+* the picture size.
+*/
+
+void TestPixmap::boundingRegionTest()
+{
+    Pixmap testPic(QPixmap("dummy_personal_infotab_background.png")); //350x300 pix
+    QPixmap refPic("dummy_personal_infotab_background.png");
+    QRectF boundArea = testPic.boundingRect();
+    QRectF refArea;
+    refArea.setSize(refPic.size());
+    QVERIFY(boundArea.size()==refArea.size());
+}
+
+bool TestPixmap::pixelCompareImages( const QImage &a, const QImage &b )
+{
+  if( a.size() != b.size() )
+    return false;
+
+  if( a.format() != b.format() )
+    return false;
+
+  for( int x=0; x<a.width(); ++x )
+    for( int y=0; y<a.height(); ++y )
+      if( a.pixel(x,y) != b.pixel(x,y) )
+        return false;
+
+  return true;
+}
+
+QTEST_MAIN(TestPixmap)
+#include "testpixmap.moc"
+
+
diff --git a/tests/ui/pixmap/testpixmap.pro b/tests/ui/pixmap/testpixmap.pro
new file mode 100644 (file)
index 0000000..b562322
--- /dev/null
@@ -0,0 +1,10 @@
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = pixmap 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+SOURCES += testpixmap.cpp \
+       ../../../src/ui/pixmap.cpp
+HEADERS += ../../../src/ui/pixmap.h