mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
* threaded reader were normal members causing a crash when those were moved in their own thread * we need own event processing for unit test * Network request needs to be generated in main thread * don`t shutdown readers on QCoreApplication::aboutToQuit, let CApplication handle it * use CApplication in unit test (as in real world) Unrelated: * access global setup via application
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
/* Copyright (C) 2015
|
|
* swift project community / contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef BLACKCORETEST_TESTREADERS_H
|
|
#define BLACKCORETEST_TESTREADERS_H
|
|
|
|
//! \cond PRIVATE_TESTS
|
|
//! \file
|
|
//! \ingroup testblackcore
|
|
|
|
#include "blackcore/networkvatlib.h"
|
|
#include "blackcore/modeldatareader.h"
|
|
#include "blackcore/icaodatareader.h"
|
|
#include <QtTest/QtTest>
|
|
|
|
namespace BlackCoreTest
|
|
{
|
|
/*!
|
|
* Test data readers (for bookings, JSON, etc.)
|
|
*/
|
|
class CTestReaders : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Constructor.
|
|
explicit CTestReaders(QObject *parent = nullptr);
|
|
|
|
//! Destructor
|
|
~CTestReaders();
|
|
|
|
private slots:
|
|
//! Read ICAO data
|
|
void readIcaoData();
|
|
|
|
//! Read model data
|
|
void readModelData();
|
|
|
|
private:
|
|
BlackCore::CIcaoDataReader *m_icaoReader = nullptr;
|
|
BlackCore::CModelDataReader *m_modelReader = nullptr;
|
|
|
|
//! Test if server is available
|
|
static bool pingServer(const BlackMisc::Network::CUrl &url);
|
|
};
|
|
|
|
} //namespace
|
|
|
|
//! \endcond
|
|
|
|
#endif // guard
|