MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / section15pty

Function section15pty

tests/CAT_Flex_test.cpp:1443–1466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1441};
1442
1443void section15pty(Runner& r, const QString& ptyPath)
1444{
1445 r.section(QStringLiteral("Section 15 — PTY round-trip (%1)").arg(ptyPath));
1446
1447 PtyClient p;
1448 if (!p.openDevice(ptyPath)) {
1449 for (const char* name : { "15.1 PTY ID;", "15.2 PTY ZZFA;", "15.3 PTY PS;" })
1450 r.skip(QString::fromLatin1(name),
1451 QStringLiteral("cannot open %1").arg(ptyPath));
1452 return;
1453 }
1454
1455 QString resp = p.query(QStringLiteral("ID"));
1456 r.check(QStringLiteral("15.1 ID; via PTY → valid model ID"),
1457 kValidIDs.contains(resp), repr(resp));
1458
1459 resp = p.query(QStringLiteral("ZZFA"));
1460 r.check(QStringLiteral("15.2 ZZFA; via PTY → \"ZZFA\" + 11-digit Hz"),
1461 resp.startsWith(QLatin1String("ZZFA")) && isDigits(resp.mid(4), 11), repr(resp));
1462
1463 resp = p.query(QStringLiteral("PS"));
1464 r.check(QStringLiteral("15.3 PS; via PTY → PS1"),
1465 resp == QLatin1String("PS1"), repr(resp));
1466}
1467#else
1468void section15pty(Runner& r, const QString& ptyPath)
1469{

Callers 1

mainFunction · 0.85

Calls 8

containsMethod · 0.80
reprFunction · 0.70
isDigitsFunction · 0.70
sectionMethod · 0.45
openDeviceMethod · 0.45
skipMethod · 0.45
queryMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected