First unit test implemented!
authorMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 21 Nov 2010 21:41:12 +0000 (23:41 +0200)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 21 Nov 2010 21:41:12 +0000 (23:41 +0200)
src/dataobjects/emufrontobject.cpp
src/db/dbfilepath.cpp
src/debian/changelog
testing/EmuFrontTesting/EmuFrontTesting.pro [new file with mode: 0644]
testing/EmuFrontTesting/main.cpp [new file with mode: 0644]
testing/EmuFrontTesting/platformtest.cpp [new file with mode: 0644]
testing/EmuFrontTesting/platformtest.h [new file with mode: 0644]

index f3f1774..1b94837 100644 (file)
@@ -49,7 +49,7 @@ EmuFrontObject& EmuFrontObject::operator =(const EmuFrontObject &ob)
 
 bool EmuFrontObject::operator ==(const EmuFrontObject &sup)
 {
-    return (id >= 0 && id == sup.id);
+    return (id >= 0 && id == sup.id && sup.name == name);
 }
 
 bool EmuFrontObject::operator !=(const EmuFrontObject &sup)
index b77d48b..b75ef52 100644 (file)
@@ -112,7 +112,8 @@ bool DbFilePath::deleteDataObject(int id) const
 
 QString DbFilePath::constructSelect(QString where) const
 {
-    return QString("SELECT filepath.id AS FilePathId, "
+    return QString("SELECT "
+            "filepath.id AS FilePathId, "
             "filepath.name AS Name, "
             "datetime(filepath.lastscanned, 'unixepoch') AS LastScanned, "
             "setup.id AS SetupId, "
index 52c6268..74ed129 100644 (file)
@@ -1,3 +1,12 @@
+emufront (0.1.8) unstable; urgency=low
+
+  * Fixed a bug in the edit dialog fields: the fields were not cleared 
+    if an object was first edited or added and then add dialog was started.
+  * Fixed bug in main window: selected platform and media types remain selected 
+    after update button is pressed.
+    
+ -- Mikko Keinänen <mikko.keinanen@gmail.com>  Fri, 20 Nov 2010 23:16:00 +0200
+
 emufront (0.1.7) unstable; urgency=low
 
   * Database file renamed to 'emufront.db.sqlite'
@@ -10,7 +19,7 @@ emufront (0.1.7) unstable; urgency=low
   * The 'last scanned' time stamp is updated for media image paths after
     scanning
     
- -- Mikko Keinänen <mikko.keinanen@gmail.com>  Fri, 19 Oct 2010 22:52:00 +0200
+ -- Mikko Keinänen <mikko.keinanen@gmail.com>  Fri, 19 Nov 2010 22:52:00 +0200
 
 emufront (0.1.6) unstable; urgency=low
 
@@ -19,16 +28,16 @@ emufront (0.1.6) unstable; urgency=low
   * UI update: Label and tooltip to set up configuration editor.
   * UI update: Added a confirmation dialog to file paths scanning.
 
- -- Mikko Keinänen <mikko.keinanen@gmail.com>  Tue, 16 Oct 2010 00:18:00 +0200
+ -- Mikko Keinänen <mikko.keinanen@gmail.com>  Tue, 16 Nov 2010 00:18:00 +0200
 
 emufront (0.1.5) unstable; urgency=low
 
   * Bug fixed: files were not removed from temporary file directory.
 
- -- Mikko Keinänen <mikko.keinanen@gmail.com>  Sun, 14 Oct 2010 23:22:21 +0200
+ -- Mikko Keinänen <mikko.keinanen@gmail.com>  Sun, 14 Nov 2010 23:22:21 +0200
  
 emufront (0.1.4) unstable; urgency=low
 
   * Initial Official Release.
 
- -- Mikko Keinänen <mikko.keinanen@gmail.com>  Thu, 13 Oct 2010 22:30:31 +0200
+ -- Mikko Keinänen <mikko.keinanen@gmail.com>  Thu, 13 Nov 2010 22:30:31 +0200
diff --git a/testing/EmuFrontTesting/EmuFrontTesting.pro b/testing/EmuFrontTesting/EmuFrontTesting.pro
new file mode 100644 (file)
index 0000000..0a3340a
--- /dev/null
@@ -0,0 +1,34 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-11-21T22:52:33
+#
+#-------------------------------------------------
+
+QT       += core
+QT       += testlib
+QT       -= gui
+
+#INCLUDEPATH += "../../src/dataobjects"
+#include("../../src/emufront.pro")
+
+#INCLUDEPATH += . "../../src/"
+TARGET = EmuFrontTesting
+CONFIG   += console
+CONFIG   -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+    platformtest.cpp \
+    ../../src/dataobjects/platform.cpp \
+    ../../src/dataobjects/emufrontobject.cpp \
+    ../../src/dataobjects/emufrontfileobject.cpp \
+    ../../src/dataobjects/emufrontfile.cpp
+
+HEADERS += \
+    platformtest.h \
+    ../../src/dataobjects/platform.h \
+    ../../src/dataobjects/emufrontobject.h \
+    ../../src/dataobjects/emufrontfileobject.h \
+    ../../src/dataobjects/emufrontfile.h
diff --git a/testing/EmuFrontTesting/main.cpp b/testing/EmuFrontTesting/main.cpp
new file mode 100644 (file)
index 0000000..5b9a1b1
--- /dev/null
@@ -0,0 +1,11 @@
+#include "platformtest.h"
+
+int main(int argc, char *argv[])
+{
+    PlatformTest plfTest;
+    QTest::qExec(&plfTest, argc, argv);
+
+    // More tests here...
+
+    return 0;
+}
diff --git a/testing/EmuFrontTesting/platformtest.cpp b/testing/EmuFrontTesting/platformtest.cpp
new file mode 100644 (file)
index 0000000..011d987
--- /dev/null
@@ -0,0 +1,15 @@
+#include "platformtest.h"
+#include "../../src/dataobjects/platform.h"
+
+/* Platforms are equal if the following fields match:
+    - id (int)
+    - name (QString)
+    - filename (QString)
+*/
+void PlatformTest::equals()
+{
+    Platform p1(1, "testa");
+    Platform p2(1, "test");
+    // This should return true
+    QVERIFY(p1 != p2);
+}
diff --git a/testing/EmuFrontTesting/platformtest.h b/testing/EmuFrontTesting/platformtest.h
new file mode 100644 (file)
index 0000000..623d598
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef PLATFORMTEST_H
+#define PLATFORMTEST_H
+
+#include <QObject>
+#include <QtTest/QtTest>
+
+class PlatformTest : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void equals();
+
+};
+
+#endif // PLATFORMTEST_H