| 1441 | }; |
| 1442 | |
| 1443 | void 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 |
| 1468 | void section15pty(Runner& r, const QString& ptyPath) |
| 1469 | { |