29 using namespace swift::misc::aviation;
30 using namespace swift::misc::geo;
31 using namespace swift::misc::physical_quantities;
32 using namespace swift::misc::network;
33 using namespace swift::misc::simulation;
34 using namespace swift::config;
35 using namespace swift::core::fsd;
37 namespace SwiftFsdTest
55 void testConstructor();
57 void testDeletePilot();
58 void testTextMessage();
59 void testRadioMessage();
60 void testClientQueryAtis();
61 void testClientResponseAtis();
62 void testPilotDataUpdate();
63 void testAtcDataUpdate();
65 void testClientResponseEmptyType();
66 void testClientResponseRealName1();
67 void testClientResponseRealName2();
68 void testClientResponseRealName3();
69 void testClientResponseCapabilities();
70 void testPlaneInfoRequestFsinn();
71 void testPlaneInformationFsinn();
73 void testSendPilotLogin();
74 void testSendAtcLogin();
75 void testSendDeletePilot();
76 void testSendDeleteAtc();
77 void testSendPilotDataUpdate1();
78 void testSendPilotDataUpdate2();
79 void testSendPilotDataUpdate3();
80 void testSendAtcDataUpdate();
83 void testSendClientResponse1();
84 void testSendClientResponse2();
85 void testSendClientQuery1();
86 void testSendClientQuery2();
87 void testSendClientQuery3();
88 void testSendTextMessage1();
89 void testSendTextMessage2();
90 void testSendRadioMessage1();
91 void testSendRadioMessage2();
92 void testSendFlightPlanFaa();
93 void testSendFlightPlanIcao();
94 void testSendPlaneInfoRequest();
95 void testSendPlaneInformation1();
96 void testSendPlaneInformation2();
97 void testSendPlaneInformation3();
98 void testSendPlaneInformation4();
99 void testSendAircraftConfiguration();
100 void testSendIncrementalAircraftConfiguration();
101 void testCom1FreqQueryResponse();
102 void testPlaneInfoRequestResponse();
109 const CServer &localTestServer();
114 const CServer &CTestFSDClient::localTestServer()
116 static const CServer dvp(
"Testserver",
"Client project testserver",
"localhost", 6809,
118 CEcosystem(CEcosystem::swiftTest()), CServer::FSDServerVatsim);
122 void CTestFSDClient::init()
124 const CServer server = localTestServer();
126 COwnAircraftProviderDummy::instance()->updateOwnCallsign(
"ABCD");
134 model.setSimulator(CSimulatorInfo::xplane());
135 QString modelDescription(
"[CSL]");
136 model.setDescription(modelDescription);
137 COwnAircraftProviderDummy::instance()->updateOwnModel(model);
141 CFrequency frequency(123.000, CFrequencyUnit::MHz());
142 COwnAircraftProviderDummy::instance()->updateActiveComFrequency(frequency, CComSystem::Com1, {});
144 m_client =
new CFSDClient(CClientProviderDummy::instance(), COwnAircraftProviderDummy::instance(),
145 CRemoteAircraftProviderDummy::instance(),
this);
146 m_client->setUnitTestMode(
true);
147 m_client->setCallsign(
"ABCD");
148 m_client->setClientName(
"Test Client");
149 m_client->setVersion(0, 8);
150 m_client->setClientCapabilities(Capabilities::AtcInfo | Capabilities::AircraftInfo |
151 Capabilities::AircraftConfig);
153 m_client->setServer(server);
154 m_client->setPilotRating(PilotRating::Student);
155 m_client->setSimType(CSimulatorInfo::xplane());
156 m_client->setPilotRating(PilotRating::Student);
157 #ifdef SWIFT_VATSIM_SUPPORT
158 QString key(
"727d1efd5cb9f8d2c28372469d922bb4");
159 m_client->setClientIdAndKey(0xb9ba, key.toLocal8Bit());
163 void CTestFSDClient::cleanup() {
delete m_client; }
165 void CTestFSDClient::testConstructor() {}
167 void CTestFSDClient::testDeleteAtc()
169 QSignalSpy spy(m_client, &CFSDClient::deleteAtcReceived);
170 m_client->sendFsdMessage(
"#DAEDDM_OBS:1234567\r\n");
175 QCOMPARE(arguments.
at(0).toString(),
"1234567");
178 void CTestFSDClient::testDeletePilot()
180 QSignalSpy spy(m_client, &CFSDClient::deletePilotReceived);
181 m_client->sendFsdMessage(
"#DPOEHAB:1234567\r\n");
186 QCOMPARE(arguments.
at(0).toString(),
"1234567");
189 void CTestFSDClient::testTextMessage()
191 QSignalSpy spy(m_client, &CFSDClient::textMessagesReceived);
192 m_client->sendFsdMessage(
"#TMEDMM_CTR:BER721:Hey how are you doing?\r\n");
205 void CTestFSDClient::testRadioMessage()
208 const CFrequency frequency(124050, CFrequencyUnit::kHz());
209 const QString text(
"BER721, Descend F140 when ready");
211 COwnAircraftProviderDummy::instance()->updateActiveComFrequency(
CFrequency(124050, CFrequencyUnit::kHz()),
214 QSignalSpy spy(m_client, &CFSDClient::textMessagesReceived);
215 m_client->sendFsdMessage(
"#TMEDMM_CTR:@24050:BER721, Descend F140 when ready\r\n");
220 QCOMPARE(receivedMessages.size(), 1);
226 QSignalSpy spy2(m_client, &CFSDClient::textMessagesReceived);
227 m_client->sendFsdMessage(
"#TMEDMM_CTR:@24050&@27000:BER721, Descend F140 when ready\r\n");
232 QCOMPARE(receivedMessages.size(), 1);
233 message = receivedMessages.front();
239 void CTestFSDClient::testClientQueryAtis()
243 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
245 m_client->sendClientQueryAtis(callsign);
251 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:EDLW_TWR:ATIS");
254 void CTestFSDClient::testClientResponseAtis()
257 m_client->sendClientQueryAtis(callsign);
259 QSignalSpy spyLogoff(m_client, &CFSDClient::atisLogoffTimeReplyReceived);
260 QSignalSpy spyAtis(m_client, &CFSDClient::atisReplyReceived);
262 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:V:VoiceRoom");
263 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:T:Dortmund Tower");
264 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:T:Useful information");
265 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:T:More useful information");
266 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:Z:2000z");
267 m_client->sendFsdMessage(
"$CREDLW_TWR:ABCD:ATIS:E:6");
275 QCOMPARE(callsign, receivedCallsign);
276 QCOMPARE(receivedLogoffTime,
"2000z");
284 QCOMPARE(callsign, receivedCallsign);
285 QCOMPARE(atisMessage.
toQString(),
"Dortmund Tower\nUseful information\nMore useful information");
288 void CTestFSDClient::testPilotDataUpdate()
290 QSignalSpy spy(m_client, &CFSDClient::pilotDataUpdateReceived);
291 m_client->sendFsdMessage(
"@N:ABCD:1200:1:48.353855:11.786155:110:0:4290769188:1\r\n");
299 QCOMPARE(situation.getCallsign().asString(),
"ABCD");
300 QCOMPARE(transponder.getTransponderMode(), CTransponder::ModeC);
301 QCOMPARE(transponder.getTransponderCode(), 1200);
302 QCOMPARE(situation.getPosition().latitude(),
CLatitude(48.353855, CAngleUnit::deg()));
303 QCOMPARE(situation.getPosition().longitude(),
CLongitude(11.786155, CAngleUnit::deg()));
305 QCOMPARE(situation.getPressureAltitude(),
307 QCOMPARE(situation.getGroundSpeed(),
CSpeed(0.0, CSpeedUnit::kts()));
315 void CTestFSDClient::testAtcDataUpdate()
317 QSignalSpy spy(m_client, &CFSDClient::atcDataUpdateReceived);
318 m_client->sendFsdMessage(
"%ZZZZ_APP:28200:5:150:5:48.11028:16.56972:0\r\n");
320 const CFrequency freq(128200, CFrequencyUnit::kHz());
322 const CLength range(150.0, CLengthUnit::NM());
333 void CTestFSDClient::testPong()
335 QSignalSpy spy(m_client, &CFSDClient::pongReceived);
336 m_client->sendFsdMessage(
"$POSERVER:BER368:90835991\r\n");
341 QCOMPARE(arguments.
at(0).toString(),
"SERVER");
343 arguments.
at(1).toDouble(&ok);
347 void CTestFSDClient::testClientResponseEmptyType() { m_client->sendFsdMessage(
"$CRDLH123:BER721::Jon Doe\r\n"); }
349 void CTestFSDClient::testClientResponseRealName1()
351 QSignalSpy spy(m_client, &CFSDClient::realNameResponseReceived);
352 m_client->sendFsdMessage(
"$CRDLH123:BER721:RN:Jon Doe\r\n");
357 QCOMPARE(arguments.
at(0).toString(),
"DLH123");
358 QCOMPARE(arguments.
at(1).toString(),
"Jon Doe");
361 void CTestFSDClient::testClientResponseRealName2()
363 QSignalSpy spy(m_client, &CFSDClient::realNameResponseReceived);
364 m_client->sendFsdMessage(
"$CRDLH123:BER721:RN:Jon Doe:\r\n");
369 QCOMPARE(arguments.
at(0).toString(),
"DLH123");
370 QCOMPARE(arguments.
at(1).toString(),
"Jon Doe");
373 void CTestFSDClient::testClientResponseRealName3()
375 QSignalSpy spy(m_client, &CFSDClient::realNameResponseReceived);
376 m_client->sendFsdMessage(
"$CRDLH123:BER721:RN:Jon Doe::1\r\n");
381 QCOMPARE(arguments.
at(0).toString(),
"DLH123");
382 QCOMPARE(arguments.
at(1).toString(),
"Jon Doe");
385 void CTestFSDClient::testClientResponseCapabilities()
387 QSignalSpy spy(m_client, &CFSDClient::capabilityResponseReceived);
388 m_client->sendFsdMessage(
"$CRAUA64MN:DECHK:CAPS:VERSION=1:ATCINFO=1:MODELDESC=1:ACCONFIG=1\r\n");
393 auto caps = arguments.
at(1).
value<swift::misc::network::CClient::Capabilities>();
394 QVERIFY(caps.testFlag(CClient::FsdWithAircraftConfig));
397 void CTestFSDClient::testPlaneInfoRequestFsinn()
399 QSignalSpy spy(m_client, &CFSDClient::planeInformationFsinnReceived);
400 m_client->sendFsdMessage(
"#SBLHA449:DLH53M:FSIPIR:1::A320:10.05523:0.49785:1320.00000:2.AB13B127.5611C1A2::"
401 "A320-200 Airbus Leipzig Air CFM\r\n");
414 void CTestFSDClient::testPlaneInformationFsinn()
416 QSignalSpy spy(m_client, &CFSDClient::planeInformationFsinnReceived);
417 m_client->sendFsdMessage(
"#SBLHA449:AUA89SY:FSIPI:1::A320:10.05523:0.49785:1320.00000:2.AB13B127.5611C1A2::"
418 "A320-200 Airbus Leipzig Air CFM\r\n");
427 void CTestFSDClient::testSendPilotLogin()
429 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
431 m_client->sendLogin();
437 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#APABCD:SERVER:1234567:123456:1:101:16:Test User");
440 void CTestFSDClient::testSendAtcLogin()
442 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
443 m_client->setLoginMode(CLoginMode::Observer);
444 m_client->setAtcRating(AtcRating::Controller1);
445 m_client->sendLogin();
451 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#AAABCD:SERVER:Test User:1234567:123456:5:101");
454 void CTestFSDClient::testSendDeletePilot()
456 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
458 m_client->sendDeletePilot();
464 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#DPABCD:1234567");
467 void CTestFSDClient::testSendDeleteAtc()
469 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
471 m_client->sendDeleteAtc();
477 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#DAABCD:1234567");
480 void CTestFSDClient::testSendPilotDataUpdate1()
482 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
485 const CHeading heading(25.0, CAngleUnit::deg());
486 const CAngle pitch(1.0, CAngleUnit::deg());
487 const CAngle bank(1.0, CAngleUnit::deg());
488 const CSpeed gs(0.0, CSpeedUnit::kts());
498 COwnAircraftProviderDummy::instance()->updateOwnSituation(situation);
499 COwnAircraftProviderDummy::instance()->updateCockpit({}, {},
CTransponder(1200, CTransponder::ModeC), {});
501 m_client->sendPilotDataUpdate();
507 const QString fsdRawMessage = fsdMessage.getRawMessage();
510 QCOMPARE(fsdRawMessage,
"FSD Sent=>@N:ABCD:1200:1:48.35386:11.78616:110:0:4286566684:1");
513 void CTestFSDClient::testSendPilotDataUpdate2()
515 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
518 const CHeading heading(25.0, CAngleUnit::deg());
519 const CAngle pitch(0.0, CAngleUnit::deg());
520 const CAngle bank(0.0, CAngleUnit::deg());
521 const CSpeed gs(0.0, CSpeedUnit::kts());
531 COwnAircraftProviderDummy::instance()->updateOwnSituation(situation);
532 COwnAircraftProviderDummy::instance()->updateCockpit({}, {},
CTransponder(1200, CTransponder::ModeC), {});
534 m_client->sendPilotDataUpdate();
543 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>@N:ABCD:1200:1:48.35386:11.78616:110:0:284:1");
547 void CTestFSDClient::testSendPilotDataUpdate3()
549 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
552 const CHeading heading(25.0, CAngleUnit::deg());
553 const CAngle pitch(-1.0, CAngleUnit::deg());
554 const CAngle bank(-1.0, CAngleUnit::deg());
555 const CSpeed gs(0.0, CSpeedUnit::kts());
565 COwnAircraftProviderDummy::instance()->updateOwnSituation(situation);
566 COwnAircraftProviderDummy::instance()->updateCockpit({}, {},
CTransponder(1200, CTransponder::ModeC), {});
568 m_client->sendPilotDataUpdate();
577 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>@N:ABCD:1200:1:48.35386:11.78616:110:0:8397084:1");
580 void CTestFSDClient::testSendAtcDataUpdate()
582 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
583 m_client->sendAtcDataUpdate(48.11028, 8.56972);
589 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>%ABCD:99998:0:300:1:48.11028:8.56972:0");
592 void CTestFSDClient::testSendPing()
594 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
595 m_client->sendPing(
"SERVER");
601 QVERIFY(fsdMessage.getRawMessage().contains(
"FSD Sent=>$PIABCD:SERVER:"));
604 void CTestFSDClient::testSendPong()
606 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
607 m_client->sendPong(
"SERVER",
"123456789");
613 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$POABCD:SERVER:123456789");
616 void CTestFSDClient::testSendClientResponse1()
618 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
619 m_client->sendClientResponse(ClientQueryType::RealName,
"ZZZZ_TWR");
625 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CRABCD:ZZZZ_TWR:RN:Test User::1");
628 void CTestFSDClient::testSendClientResponse2()
630 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
631 m_client->sendClientResponse(ClientQueryType::Capabilities,
"ZZZZ_TWR");
637 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CRABCD:ZZZZ_TWR:CAPS:ATCINFO=1:MODELDESC=1:ACCONFIG=1");
640 void CTestFSDClient::testSendClientQuery1()
642 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
643 m_client->sendClientQuery(ClientQueryType::RealName,
"ZZZZ_TWR");
649 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:ZZZZ_TWR:RN");
652 void CTestFSDClient::testSendClientQuery2()
654 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
655 m_client->sendClientQueryIsValidAtc(
"EDDM_TWR");
661 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:SERVER:ATC:EDDM_TWR");
664 void CTestFSDClient::testSendClientQuery3()
666 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
667 m_client->sendClientQueryAircraftConfig(
"DLH123");
673 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:DLH123:ACC:{\"request\":\"full\"}");
676 void CTestFSDClient::testSendTextMessage1()
678 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
679 m_client->sendTextMessage(
"ZZZZ_TWR",
"hey dude!");
685 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#TMABCD:ZZZZ_TWR:hey dude!");
688 void CTestFSDClient::testSendTextMessage2()
690 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
691 m_client->sendTextMessage(TextMessageGroups::AllSups,
"Please help!!!");
697 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#TMABCD:*S:Please help!!!");
700 void CTestFSDClient::testSendRadioMessage1()
702 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
704 m_client->sendRadioMessage(frequencies,
"hey dude!");
710 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#TMABCD:@24050:hey dude!");
713 void CTestFSDClient::testSendRadioMessage2()
715 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
717 m_client->sendRadioMessage(frequencies,
"hey dude!");
723 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#TMABCD:@24050&@35725:hey dude!");
726 void CTestFSDClient::testSendFlightPlanFaa()
729 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
736 CFlightPlan fp({}, info,
"EGLL",
"KORD",
"NONE", takeoffTimePlanned, takeoffTimeActual,
737 CTime(8.25, CTimeUnit::h()),
CTime(9.5, CTimeUnit::h()), flightLevel,
739 m_client->sendFlightPlan(fp);
746 fsdMessage.getRawMessage(),
747 "FSD Sent=>$FPABCD:SERVER:V:H/B744/L:420:EGLL:1530:1535:FL350:KORD:8:15:9:30:NONE:UNIT TEST:EGLL.KORD");
750 void CTestFSDClient::testSendFlightPlanIcao()
752 CServer server = localTestServer();
754 m_client->setServer(server);
756 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
763 CFlightPlan fp({}, info,
"EGLL",
"KORD",
"NONE", takeoffTimePlanned, takeoffTimeActual,
764 CTime(8.25, CTimeUnit::h()),
CTime(9.5, CTimeUnit::h()), flightLevel,
766 m_client->sendFlightPlan(fp);
773 fsdMessage.getRawMessage(),
774 "FSD Sent=>$FPABCD:SERVER:V:B748/H-SDE3FGHIM1M2RWXY/LB1:420:EGLL:1530:1535:FL350:KORD:8:15:9:30:NONE:UNIT "
778 void CTestFSDClient::testSendPlaneInfoRequest()
780 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
781 m_client->sendPlaneInfoRequest(
"XYZ");
787 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:XYZ:PIR");
790 void CTestFSDClient::testSendPlaneInformation1()
792 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
793 m_client->sendPlaneInformation(
"XYZ",
"B744",
"BAW");
799 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744:AIRLINE=BAW");
802 void CTestFSDClient::testSendPlaneInformation2()
804 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
805 m_client->sendPlaneInformation(
"XYZ",
"B744",
"BAW",
"UNION");
811 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744:AIRLINE=BAW:LIVERY=UNION");
814 void CTestFSDClient::testSendPlaneInformation3()
816 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
817 m_client->sendPlaneInformation(
"XYZ",
"B744");
823 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:XYZ:PI:GEN:EQUIPMENT=B744");
826 void CTestFSDClient::testSendPlaneInformation4()
828 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
829 m_client->sendPlaneInformation(
"XYZ",
"",
"",
"UNION");
835 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:XYZ:PI:GEN:LIVERY=UNION");
838 void CTestFSDClient::testSendAircraftConfiguration()
840 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
841 m_client->sendAircraftConfiguration(
"XYZ", R
"({"request":"full"})");
847 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:XYZ:ACC:{\"request\":\"full\"}");
850 void CTestFSDClient::testSendIncrementalAircraftConfiguration()
852 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
854 CAircraftParts parts = COwnAircraftProviderDummy::instance()->getOwnAircraftParts();
856 COwnAircraftProviderDummy::instance()->updateOwnParts(parts);
858 m_client->sendIncrementalAircraftConfig();
864 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CQABCD:@94836:ACC:{\"config\":{\"gear_down\":true}}");
867 void CTestFSDClient::testCom1FreqQueryResponse()
869 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
870 m_client->sendFsdMessage(
"$CQEDMM_CTR:ABCD:C?\r\n");
876 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>$CRABCD:EDMM_CTR:C?:123.000");
879 void CTestFSDClient::testPlaneInfoRequestResponse()
881 QSignalSpy spy(m_client, &CFSDClient::rawFsdMessage);
882 m_client->sendFsdMessage(
"#SBEDMM_CTR:ABCD:PIR\r\n");
888 QCOMPARE(fsdMessage.getRawMessage(),
"FSD Sent=>#SBABCD:EDMM_CTR:PI:GEN:EQUIPMENT=B737:AIRLINE=BER");
891 void CTestFSDClient::testAuth()
929 if (!CNetworkUtils::canConnect(url, m, 2500))
931 qWarning() <<
"Skipping unit test as" << url.
getFullUrl() <<
"cannot be connected";
987 #include "testfsdclient.moc"
CTestFSDClient(QObject *parent=nullptr)
Constructor.
~CTestFSDClient()=default
Destructor.
FSD client Todo: Send (interim) data updates automatically Todo Check ':' in FSD messages....
static const CIdentifier & anonymous()
Returns an anonymous identifier, which is a valid identifier without name.
Value object for ICAO classification.
Value object encapsulating information of aircraft's parts.
void setGearDown(bool down)
Set gear down.
Value object encapsulating information of an aircraft's situation.
void setPressureAltitude(const CAltitude &altitude)
Set pressure altitude.
void setGroundSpeed(const physical_quantities::CSpeed &groundspeed)
Set ground speed.
void setBank(const physical_quantities::CAngle &bank)
Set bank (angle)
void setHeading(const CHeading &heading)
Set heading.
void setAltitude(const CAltitude &altitude)
Set altitude.
void setPitch(const physical_quantities::CAngle &pitch)
Set pitch.
void setPosition(const geo::CCoordinateGeodetic &position)
Set position.
Value object for ICAO classification.
Altitude as used in aviation, can be AGL or MSL altitude.
@ PressureAltitude
Altitude above the standard datum plane.
@ FlightLevel
Flight level.
Value object encapsulating information of a callsign.
Flightplan-related information about an aircraft (aircraft ICAO, equipment and WTC)
Value object for a flight plan.
@ VFR
Visual flight rules.
Heading as used in aviation, can be true or magnetic heading.
Value object encapsulating information about an airpot.
void setCombinedCode(const QString &code)
Combined code.
bool setAirlineIcaoCode(const CAirlineIcaoCode &airlineIcao)
Airline ICAO code.
QString toQString(bool i18n=false) const
Cast as QString.
Ecosystem of server belonging together.
Value object for a FSD setup.
Value object for a raw FSD message.
Value object encapsulating information of a server.
int getPort() const
Get port.
const QString & getAddress() const
Get address.
void setFsdSetup(const CFsdSetup &setup)
Set FSD setup.
Value object encapsulating information of a text message.
const QString & getMessage() const
Get message.
const aviation::CCallsign & getSenderCallsign() const
Get callsign (from)
const aviation::CCallsign & getRecipientCallsign() const
Get callsign (to)
const physical_quantities::CFrequency & getFrequency() const
Get frequency.
Value object encapsulating a list of text messages.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
QString getFullUrl(bool withQuery=true) const
Qualified name.
Value object encapsulating information of a user.
Physical unit angle (radians, degrees)
Physical unit length (length)
Aircraft model (used by another pilot, my models on disk)
Free functions in swift::misc.
void registerMetadata()
Register all relevant metadata in Misc.
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
void setTimeZone(const QTimeZone &toZone, QDateTime::TransitionResolution resolve)
QList< T >::const_reference at(qsizetype i) const const
qsizetype size() const const
QList< T >::value_type takeFirst()
QList< T >::value_type takeLast()
T value(qsizetype i) const const
QCOMPARE(actual, expected)
SWIFTTEST_MAIN(SwiftFsdTest::CTestFSDClient)
main
bool pingServer(const CServer &server)
Ping the server.