diff ui/tests/mainwindowtest.cpp @ 563:aee3eb10bbba

Add unit test for sw update execution and fix shell execute params
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 15:18:06 +0000
parents dd8a295d5b4d
children 2fd4f9980a2a
line wrap: on
line diff
--- a/ui/tests/mainwindowtest.cpp	Thu May 22 15:29:59 2014 +0200
+++ b/ui/tests/mainwindowtest.cpp	Thu May 22 15:18:06 2014 +0000
@@ -8,6 +8,8 @@
 
 #include "mainwindowtest.h"
 
+#include <QSignalSpy>
+
 #ifdef Q_OS_WIN
  Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
 #else
@@ -26,7 +28,13 @@
 }
 
 void MainWindowTest::testValidUpdate() {
-    // TODO
+    QSignalSpy closed(this, SIGNAL(closeCalled()));
+#ifdef Q_OS_WIN
+    installNewSW(QString::fromLatin1("c:/fakeinst.exe"), QDateTime::currentDateTime());
+#else
+    installNewSW(QString::fromLatin1("fakeinst"), QDateTime::currentDateTime());
+#endif
+    QVERIFY(closed.count() == 1);
 }
 
 QTEST_MAIN(MainWindowTest);

http://wald.intevation.org/projects/trustbridge/