Fixes in samples

* removed qSleep / dependency of Qt test libs
* QCoreApplication not required
This commit is contained in:
Klaus Basan
2014-06-15 19:19:07 +02:00
parent f0a2bc4f65
commit dbc3339599
3 changed files with 7 additions and 6 deletions

View File

@@ -19,8 +19,11 @@ using namespace BlackMiscTest;
*/ */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// QCoreApplication a(argc, argv);
Q_UNUSED(argc);
Q_UNUSED(argv);
BlackMisc::initResources(); BlackMisc::initResources();
QCoreApplication a(argc, argv);
CSamplesJson::samples(); CSamplesJson::samples();
CSamplesChangeObject::samples(); CSamplesChangeObject::samples();
CSamplesContainer::samples(); CSamplesContainer::samples();

View File

@@ -2,7 +2,6 @@
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <QCoreApplication>
#include "samplesphysicalquantities.h" #include "samplesphysicalquantities.h"
#include "samplesaviation.h" #include "samplesaviation.h"
@@ -24,7 +23,6 @@ int main(int argc, char *argv[])
qDebug() << (t ? "Translator loaded" : "Translator not loaded"); qDebug() << (t ? "Translator loaded" : "Translator not loaded");
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
qDebug() << "Use I18N version, y? n?"; qDebug() << "Use I18N version, y? n?";
int yn = getchar(); int yn = getchar();
t = (yn == 'y' || yn == 'Y'); t = (yn == 'y' || yn == 'Y');
@@ -34,5 +32,5 @@ int main(int argc, char *argv[])
CSamplesPhysicalQuantities::samples(); CSamplesPhysicalQuantities::samples();
CSamplesAviation::samples(); CSamplesAviation::samples();
return a.exec(); return 0;
} }

View File

@@ -6,9 +6,9 @@
#include "samplesfscommon.h" #include "samplesfscommon.h"
#include "blacksim/fscommon/aircraftcfgentrieslist.h" #include "blacksim/fscommon/aircraftcfgentrieslist.h"
#include "blacksim/fscommon/aircraftindexer.h" #include "blacksim/fscommon/aircraftindexer.h"
#include <QDebug> #include <QDebug>
#include <QFuture> #include <QFuture>
#include <QTest>
#include <QTextStream> #include <QTextStream>
namespace BlackSimTest namespace BlackSimTest
@@ -49,7 +49,7 @@ namespace BlackSimTest
{ {
streamOut << "."; streamOut << ".";
streamOut.flush(); streamOut.flush();
QTest::qSleep(1000 * 3); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000 * 3);
} }
while (!f.isFinished()); while (!f.isFinished());
streamOut << endl << f.result() << " entries" << endl; streamOut << endl << f.result() << " entries" << endl;