Replace deprecated endl with Qt::endl

This commit is contained in:
Roland Rossgotterer
2020-04-02 10:54:07 +02:00
committed by Mat Sutcliffe
parent 1e633a5704
commit 9fa3221abc
27 changed files with 346 additions and 346 deletions

View File

@@ -1971,7 +1971,7 @@ namespace BlackCore
if (m_rawFsdMessageLogFile.isOpen())
{
QTextStream stream(&m_rawFsdMessageLogFile);
stream << rawMessage.toQString().trimmed() << endl;
stream << rawMessage.toQString().trimmed() << Qt::endl;
}
emit rawFsdMessage(rawMessage);
}

View File

@@ -80,28 +80,28 @@ namespace BlackMisc
const CVariant var;
QString s;
s = CDBusUtils::dBusSignature(cs);
out << "CCallsign" << " size: " << s.size() << " sig: " << s << endl;
out << "CCallsign" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(l);
out << "CLength" << " size: " << s.size() << " sig: " << s << endl;
out << "CLength" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(icao);
out << "CAircraftIcaoCode" << " size: " << s.size() << " sig: " << s << endl;
out << "CAircraftIcaoCode" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(airportIcao);
out << "CAirportIcaoCode" << " size: " << s.size() << " sig: " << s << endl;
out << "CAirportIcaoCode" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(livery);
out << "CLivery" << " size: " << s.size() << " sig: " << s << endl;
out << "CLivery" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(situation);
out << "CAircraftSituation" << " size: " << s.size() << " sig: " << s << endl;
out << "CAircraftSituation" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(country);
out << "CCountry" << " size: " << s.size() << " sig: " << s << endl;
out << "CCountry" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(airport);
out << "CAirport" << " size: " << s.size() << " sig: " << s << endl;
out << "CAirport" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(model);
out << "CAircraftModel" << " size: " << s.size() << " sig: " << s << endl;
out << "CAircraftModel" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(aircraft);
out << "CSimulatedAircraft" << " size: " << s.size() << " sig: " << s << endl;
out << "CSimulatedAircraft" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(aircraftList);
out << "CSimulatedAircraftList" << " size: " << s.size() << " sig: " << s << endl;
out << "CSimulatedAircraftList" << " size: " << s.size() << " sig: " << s << Qt::endl;
s = CDBusUtils::dBusSignature(var);
out << "CVariant" << " size: " << s.size() << " sig: " << s << endl;
out << "CVariant" << " size: " << s.size() << " sig: " << s << Qt::endl;
}
} // ns

View File

@@ -130,22 +130,22 @@ namespace BlackMisc
m_stream << "This is " << applicationName();
m_stream << " version " << CBuildConfig::getVersionString();
m_stream << " running on " << QSysInfo::prettyProductName();
m_stream << " " << QSysInfo::currentCpuArchitecture() << endl;
m_stream << " " << QSysInfo::currentCpuArchitecture() << Qt::endl;
m_stream << "Built from revision " << CBuildConfig::gitHeadSha1();
m_stream << " on " << CBuildConfig::buildDateAndTime() << endl;
m_stream << " on " << CBuildConfig::buildDateAndTime() << Qt::endl;
m_stream << "Built with Qt " << QT_VERSION_STR;
m_stream << " and running with Qt " << qVersion();
m_stream << " " << QSysInfo::buildAbi() << endl;
m_stream << " " << QSysInfo::buildAbi() << Qt::endl;
m_stream << "Program is going to expire on " + CBuildConfig::getEol().toString() << "." << endl;
m_stream << "Program is going to expire on " + CBuildConfig::getEol().toString() << "." << Qt::endl;
m_stream << "Application started." << endl;
m_stream << "Application started." << Qt::endl;
}
void CFileLogger::writeContentToFile(const QString &content)
{
m_stream << content << endl;
m_stream << content << Qt::endl;
}
}

View File

@@ -27,7 +27,7 @@ namespace BlackMisc
if (i > 0) { streamOut << " "; }
streamOut << (i + 1) << ") " << directoryOptions.at(i) ;
}
streamOut << endl;
streamOut << Qt::endl;
streamOut << "Select [1-" << directoryOptions.size() << "]: ";
streamOut.flush();

View File

@@ -83,25 +83,25 @@ namespace BlackMisc
{
// this code should be similar to XSwiftBus config.cpp
QTextStream ts(&configFile);
ts << "# DBus Mode - Options: p2p, session" << endl;
ts << "dbusMode = " << m_dbusMode << endl;
ts << endl;
ts << "# DBus server address - relevant for P2P mode only" << endl;
ts << "dbusAddress = " << m_dbusAddress << endl;
ts << endl;
ts << "# DBus server port - relevant for P2P mode only" << endl;
ts << "dbusPort = " << m_dbusPort << endl;
ts << endl;
ts << "# Render phase debugging - to help diagnose crashes" << endl;
ts << "debug = " << boolToOnOff(m_debug) << endl;
ts << endl;
ts << "# TCAS traffic - to disable in case of crashes" << endl;
ts << "tcas = " << boolToOnOff(m_tcas) << endl;
ts << "# DBus Mode - Options: p2p, session" << Qt::endl;
ts << "dbusMode = " << m_dbusMode << Qt::endl;
ts << Qt::endl;
ts << "# DBus server address - relevant for P2P mode only" << Qt::endl;
ts << "dbusAddress = " << m_dbusAddress << Qt::endl;
ts << Qt::endl;
ts << "# DBus server port - relevant for P2P mode only" << Qt::endl;
ts << "dbusPort = " << m_dbusPort << Qt::endl;
ts << Qt::endl;
ts << "# Render phase debugging - to help diagnose crashes" << Qt::endl;
ts << "debug = " << boolToOnOff(m_debug) << Qt::endl;
ts << Qt::endl;
ts << "# TCAS traffic - to disable in case of crashes" << Qt::endl;
ts << "tcas = " << boolToOnOff(m_tcas) << Qt::endl;
// add comment as information
ts << endl;
ts << Qt::endl;
ts << "# Updated by CXSwiftBusConfigWriter " << QDateTime::currentDateTimeUtc().toString("yyyyMMddHHmmss") << " ";
ts << endl;
ts << Qt::endl;
}
}
} // ns

View File

@@ -73,8 +73,8 @@ namespace BlackMisc
{
QDBusError error = connection.lastError();
err() << error.message();
err() << "Started dbus-daemon.exe --session (Windows)?" << endl;
err() << "Created directory session.d (e.g. ../Qt/5.8.0/qtbase/etc/dbus-1/session.d)?" << endl;
err() << "Started dbus-daemon.exe --session (Windows)?" << Qt::endl;
err() << "Created directory session.d (e.g. ../Qt/5.8.0/qtbase/etc/dbus-1/session.d)?" << Qt::endl;
qFatal("Could not register service!");
}
@@ -83,14 +83,14 @@ namespace BlackMisc
qFatal("Could not register service object!");
}
out() << "Registration running as pid: " << CTestService::getPid() << endl;
if (pTestService) { out() << "Service registered" << endl; }
out() << "Registration running as pid: " << CTestService::getPid() << Qt::endl;
if (pTestService) { out() << "Service registered" << Qt::endl; }
QString service; // service not needed
if (connection.connect(service, CTestService::ObjectPath(), CTestService::InterfaceName(),
"sendStringMessage", pTestService, SLOT(receiveStringMessage(const QString &))))
{
out() << "Connected object with DBus 'sendStringMessage'" << endl;
out() << "Connected object with DBus 'sendStringMessage'" << Qt::endl;
}
else
{
@@ -118,236 +118,236 @@ namespace BlackMisc
void CTestService::receiveStringMessage(const QString &message) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received message: " << message << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received message: " << message << Qt::endl;
}
void CTestService::receiveVariant(const CVariant &variant) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received variant: " << variant << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received variant: " << variant << Qt::endl;
}
void CTestService::receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received speed: " << speed << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received speed: " << speed << Qt::endl;
}
void CTestService::receiveComUnit(const CComSystem &comUnit) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received COM: " << comUnit << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received COM: " << comUnit << Qt::endl;
}
void CTestService::receiveAltitude(const CAltitude &altitude) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received altitude: " << altitude << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received altitude: " << altitude << Qt::endl;
}
void CTestService::receiveList(const QList<double> &list) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received list: " << list.size() << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received list: " << list.size() << Qt::endl;
}
void CTestService::receiveGeoPosition(const BlackMisc::Geo::CCoordinateGeodetic &geo) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received geo data: " << geo << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received geo data: " << geo << Qt::endl;
}
void CTestService::receiveTransponder(const CTransponder &transponder) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received transponder: " << transponder << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received transponder: " << transponder << Qt::endl;
}
void CTestService::receiveTrack(const CTrack &track) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received track: " << track << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received track: " << track << Qt::endl;
}
void CTestService::receiveLength(const BlackMisc::PhysicalQuantities::CLength &length) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received length: " << length << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received length: " << length << Qt::endl;
}
void CTestService::receiveVariantList(const CVariantList &variantList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " " << variantList.size() << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " " << variantList.size() << Qt::endl;
for (const CVariant &lv : variantList)
{
if (m_verbose) out() << " Received variant: " << lv.toQString() << endl;
if (m_verbose) out() << " Received variant: " << lv.toQString() << Qt::endl;
}
}
void CTestService::receiveCallsign(const CCallsign &callsign) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received callsign: " << callsign << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received callsign: " << callsign << Qt::endl;
}
void CTestService::receiveAtcStationList(const CAtcStationList &atcStationList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC list: " << atcStationList << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC list: " << atcStationList << Qt::endl;
}
void CTestService::receiveValueMap(const BlackMisc::CPropertyIndexVariantMap &valueMap) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received value map: " << valueMap << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received value map: " << valueMap << Qt::endl;
}
void CTestService::receiveAtcStation(const CAtcStation &station) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC station: " << station << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC station: " << station << Qt::endl;
}
CAtcStationList CTestService::pingAtcStationList(const CAtcStationList &atcStationList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATCs: " << atcStationList << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATCs: " << atcStationList << Qt::endl;
return atcStationList;
}
CSimulatedAircraftList CTestService::pingAircraftList(const CSimulatedAircraftList &aircraftList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft: " << aircraftList << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft: " << aircraftList << Qt::endl;
return aircraftList;
}
CAircraftParts CTestService::pingAircraftParts(const CAircraftParts &aircraftParts) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft parts: " << aircraftParts << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft parts: " << aircraftParts << Qt::endl;
return aircraftParts;
}
CAircraftEngine CTestService::pingAircraftEngine(const CAircraftEngine &aircraftEngine) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft engine: " << aircraftEngine << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft engine: " << aircraftEngine << Qt::endl;
return aircraftEngine;
}
CAircraftModel CTestService::pingAircraftModel(const CAircraftModel &aircraftModel) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft model: " << aircraftModel << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft model: " << aircraftModel << Qt::endl;
return aircraftModel;
}
CAircraftModelList CTestService::pingAircraftModelList(const CAircraftModelList &aircraftModels) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft modellist: " << aircraftModels << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft modellist: " << aircraftModels << Qt::endl;
return aircraftModels;
}
CAircraftLights CTestService::pingAircraftLights(const CAircraftLights &aircraftLights) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft lights: " << aircraftLights << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft lights: " << aircraftLights << Qt::endl;
return aircraftLights;
}
CSimulatedAircraft CTestService::pingSimulatedAircraft(const CSimulatedAircraft &aircraft) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping simulated aircraft: " << aircraft << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping simulated aircraft: " << aircraft << Qt::endl;
return aircraft;
}
CAirportList CTestService::pingAirportList(const CAirportList &airportList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping airports: " << airportList << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping airports: " << airportList << Qt::endl;
return airportList;
}
CPropertyIndex CTestService::pingPropertyIndex(const CPropertyIndex &properties) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << properties << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << properties << Qt::endl;
return properties;
}
CPropertyIndexVariantMap CTestService::pingIndexVariantMap(const CPropertyIndexVariantMap &indexVariantMap) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << indexVariantMap << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << indexVariantMap << Qt::endl;
return indexVariantMap;
}
CClient CTestService::pingClient(const CClient &client) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping client: " << client << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping client: " << client << Qt::endl;
return client;
}
CClientList CTestService::pingClientList(const CClientList &clientList) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping clients: " << clientList << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping clients: " << clientList << Qt::endl;
return clientList;
}
CSpeed CTestService::pingSpeed(const CSpeed &speed) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping speed: " << speed << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping speed: " << speed << Qt::endl;
return speed;
}
CAltitude CTestService::pingAltitude(const CAltitude &altitude) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping alt: " << altitude << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping alt: " << altitude << Qt::endl;
return altitude;
}
CUser CTestService::pingUser(const CUser &user) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping user: " << user << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping user: " << user << Qt::endl;
return user;
}
CAircraftSituation CTestService::pingSituation(const CAircraftSituation &situation) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping situation: " << situation << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping situation: " << situation << Qt::endl;
return situation;
}
CTransponder CTestService::pingTransponder(const CTransponder &transponder) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping transponder: " << transponder << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping transponder: " << transponder << Qt::endl;
return transponder;
}
CAtcStation CTestService::pingAtcStation(const CAtcStation &station) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATC: " << station << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATC: " << station << Qt::endl;
return station;
}
CAircraftIcaoCode CTestService::pingAircraftIcaoData(const CAircraftIcaoCode &icao) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ICAO data: " << icao << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ICAO data: " << icao << Qt::endl;
return icao;
}
CSimulatorPluginInfo CTestService::pingPluginInfo(const CSimulatorPluginInfo &info) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << info << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << info << Qt::endl;
return info;
}
BlackMisc::CVariant CTestService::pingCVariant(const CVariant &variant) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " client sent back as CVariant: " << variant.toQString() << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " client sent back as CVariant: " << variant.toQString() << Qt::endl;
return variant;
}
BlackMisc::Aviation::CFlightPlan CTestService::pingFlightPlan(const BlackMisc::Aviation::CFlightPlan &flightPlan) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << flightPlan << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << flightPlan << Qt::endl;
return flightPlan;
}
CAtcStationList CTestService::getAtcStationList(int n) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAtcStationList" << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAtcStationList" << Qt::endl;
return CTesting::createAtcStations(n, false);
}
CAircraftCfgEntriesList CTestService::getAircraftCfgEntriesList(int n) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAircraftCfgEntriesList" << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAircraftCfgEntriesList" << Qt::endl;
return CTesting::getAircraftCfgEntries(n);
}
QList<QDBusObjectPath> CTestService::getObjectPaths(int n) const
{
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << endl;
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << Qt::endl;
QList<QDBusObjectPath> paths;
paths.reserve(n);
for (int i = 0; i < n; i++)

View File

@@ -43,104 +43,104 @@ namespace BlackMisc
const CPropertyIndex pi({ 1000, 2000, 3000, 4000, 5000}); // numbers >= global index
const CPropertyIndex piPing = testServiceInterface.pingPropertyIndex(pi);
ok = pingCompare(pi, piPing, out, verbose, errors);
if (verbose) { out << "Pinged property index via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged property index via interface" << errorInfo(ok) << Qt::endl; }
const CPropertyIndexVariantMap ivm = CTestData::getCPropertyIndexVariantMap();
const CPropertyIndexVariantMap ivmPing = testServiceInterface.pingIndexVariantMap(ivm);
ok = pingCompare(ivm, ivmPing, out, verbose, errors);
if (verbose) { out << "Pinged variant map via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged variant map via interface" << errorInfo(ok) << Qt::endl; }
const CSimulatorPluginInfo pluginInfo("fsx", "FSX Simulator", "FSX", "Flight Simulator X", true);
const CSimulatorPluginInfo pluginInfoPing = testServiceInterface.pingPluginInfo(pluginInfo);
ok = pingCompare(pluginInfo, pluginInfoPing, out, verbose, errors);
if (verbose) { out << "Pinged info via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged info via interface" << errorInfo(ok) << Qt::endl; }
const CSpeed speedNotNull(22, CSpeedUnit::m_s());
const CSpeed speedNull = CSpeed(0, CSpeedUnit::nullUnit());
const CSpeed speedNotNullPing = testServiceInterface.pingSpeed(speedNotNull);
ok = pingCompare(speedNotNull, speedNotNullPing, out, verbose, errors);
if (verbose) { out << "Pinged not null speed via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged not null speed via interface" << errorInfo(ok) << Qt::endl; }
const CSpeed speedNullPing = testServiceInterface.pingSpeed(speedNull);
ok = pingCompare(speedNull, speedNullPing, out, verbose, errors);
if (verbose) { out << "Pinged null speed via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged null speed via interface" << errorInfo(ok) << Qt::endl; }
const CAtcStation station = CTestData::getRandomAtcStation();
const CAtcStation stationPing = testServiceInterface.pingAtcStation(station);
ok = pingCompare(station, stationPing, out, verbose, errors);
if (verbose) { out << "Pinged ATC station via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged ATC station via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftIcaoCode icaoData = CTestData::getDBAircraftIcaoB737();
const CAircraftIcaoCode icaoDataPing = testServiceInterface.pingAircraftIcaoData(icaoData);
ok = pingCompare(icaoData, icaoDataPing, out, verbose, errors);
if (verbose) { out << "Pinged ICAO data via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged ICAO data via interface" << errorInfo(ok) << Qt::endl; }
const CUser user = CTestData::getRandomPilot();
const CUser userPing = testServiceInterface.pingUser(user);
ok = pingCompare(user, userPing, out, verbose, errors);
if (verbose) { out << "Pinged user via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged user via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftSituation situation = CTestData::getAircraftSituationAboveMunichTower();
const CAircraftSituation situationPing = testServiceInterface.pingSituation(situation);
ok = pingCompare(situation, situationPing, out, verbose, errors);
if (verbose) { out << "Pinged situation via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged situation via interface" << errorInfo(ok) << Qt::endl; }
const CTransponder transponder(1234, "C");
const CTransponder transponderPing = testServiceInterface.pingTransponder(transponder);
ok = pingCompare(transponder, transponderPing, out, verbose, errors);
if (verbose) { out << "Pinged transponder via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged transponder via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftLights lights(true, false, true, false, true, false);
const CAircraftLights lightsPing = testServiceInterface.pingAircraftLights(lights);
ok = pingCompare(lights, lightsPing, out, verbose, errors);
if (verbose) { out << "Pinged lights via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged lights via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftEngine engine(2, false);
const CAircraftEngine enginePing = testServiceInterface.pingAircraftEngine(engine);
ok = pingCompare(engine, enginePing, out, verbose, errors);
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftEngineList engines({engine});
const CAircraftParts parts(lights, true, 11, true, engines, true);
const CAircraftParts partsPing = testServiceInterface.pingAircraftParts(parts);
ok = pingCompare(parts, partsPing, out, verbose, errors);
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftModel model = CTestData::getDbAircraftModelFsxAerosoftA320();
const CAircraftModel modelPing = testServiceInterface.pingAircraftModel(model);
ok = pingCompare(model, modelPing, out, verbose, errors);
if (verbose) { out << "Pinged model via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged model via interface" << errorInfo(ok) << Qt::endl; }
const CAircraftModelList models({ model, CTestData::getDbAircraftModelFsxA2AC172Skyhawk() });
const CAircraftModelList modelsPing = testServiceInterface.pingAircraftModelList(models);
ok = pingCompare(models, modelsPing, out, verbose, errors);
if (verbose) { out << "Pinged model list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged model list via interface" << errorInfo(ok) << Qt::endl; }
const CSimulatedAircraft aircraft = CTestData::getA320Aircraft();
const CSimulatedAircraft aircraftPing = testServiceInterface.pingSimulatedAircraft(aircraft);
ok = pingCompare(aircraft, aircraftPing, out, verbose, errors);
if (verbose) { out << "Pinged simulated aircraft via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged simulated aircraft via interface" << errorInfo(ok) << Qt::endl; }
const CAtcStationList atcStationList = CTestData::getAtcStations();
const CAtcStationList atcStationListPing = testServiceInterface.pingAtcStationList(atcStationList);
ok = pingCompare(atcStationList, atcStationListPing, out, verbose, errors);
if (verbose) { out << "Pinged ATC station list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged ATC station list via interface" << errorInfo(ok) << Qt::endl; }
const CAirportList airportList = CTesting::getAirports(10);
const CAirportList airportListPing = testServiceInterface.pingAirportList(airportList);
ok = pingCompare(airportList, airportListPing, out, verbose, errors);
if (verbose) { out << "Pinged airports list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged airports list via interface" << errorInfo(ok) << Qt::endl; }
const CClientList clients = CTesting::getClients(10);
const CClient client = clients.front();
const CClient clientPing = testServiceInterface.pingClient(client);
ok = pingCompare(client, clientPing, out, verbose, errors);
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << Qt::endl; }
const CClientList clientsPing = testServiceInterface.pingClientList(clients);
ok = pingCompare(clients, clientsPing, out, verbose, errors);
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << Qt::endl; }
CFlightPlan flightPlan;
flightPlan.setEnrouteTime(CTime(4, CTimeUnit::h()));
@@ -149,17 +149,17 @@ namespace BlackMisc
flightPlan.setCruiseTrueAirspeed(CSpeed(500, CSpeedUnit::km_h()));
const CFlightPlan flightPlanPing = testServiceInterface.pingFlightPlan(flightPlan);
ok = pingCompare(flightPlan, flightPlanPing, out, verbose, errors);
if (verbose) { out << "Pinged flight plan via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged flight plan via interface" << errorInfo(ok) << Qt::endl; }
const CVariant cv = CVariant::fromValue(clients);
const CVariant cvPing = testServiceInterface.pingCVariant(cv);
ok = pingCompare(cv.value<CClientList>(), cvPing.value<CClientList>(), out, verbose, errors);
if (verbose) { out << "Pinged CVariant(clients) list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged CVariant(clients) list via interface" << errorInfo(ok) << Qt::endl; }
const CVariant cv2 = CVariant::fromValue(aircraft);
const CVariant cv2Ping = testServiceInterface.pingCVariant(cv2);
ok = pingCompare(cv2.value<CSimulatedAircraft>(), cv2Ping.value<CSimulatedAircraft>(), out, verbose, errors);
if (verbose) { out << "Pinged CVariant(aircraft) list via interface" << errorInfo(ok) << endl; }
if (verbose) { out << "Pinged CVariant(aircraft) list via interface" << errorInfo(ok) << Qt::endl; }
// end
return errors;

View File

@@ -394,7 +394,7 @@ namespace BlackMisc
if (!equal)
{
errors++;
if (verbose) { ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << endl; }
if (verbose) { ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << Qt::endl; }
}
return equal;
}