view ui/tests/mainwindowtest.cpp @ 1384:318e8c5c4f85

Do not depend on RELEASE_BUILD for debug output this is handled by g_debug and no longer neccessary als a Macro
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 15 Jan 2015 15:57:26 +0100
parents a43ebf716abd
children
line wrap: on
line source
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */

#include "mainwindowtest.h"

#include <QSignalSpy>

#ifdef Q_OS_WIN
 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#else
 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
#endif

MainWindowTest::MainWindowTest() : MainWindow(true) {
}

void MainWindowTest::closeApp() {
    emit closeCalled();
}

void MainWindowTest::testValidUpdate() {
    QSignalSpy closed(this, SIGNAL(closeCalled()));
#ifdef Q_OS_WIN
    installNewSW(QString::fromLatin1("c:/fakeinst.exe"), QDateTime::currentDateTime());
#else
    installNewSW(QString::fromLatin1("fakeinst-signed"), QDateTime::currentDateTime());
#endif
    QVERIFY(closed.count() == 1);
}

QTEST_MAIN(MainWindowTest);

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