| 1563 | // const-qualified variables continue to work correctly. |
| 1564 | |
| 1565 | void tst_util::findBinaryInPathWithConstQStringRef() { |
| 1566 | // Pass a const-qualified variable to verify the const-ref signature compiles |
| 1567 | // and executes correctly. |
| 1568 | #ifdef Q_OS_WIN |
| 1569 | const QString binaryName = QStringLiteral("cmd.exe"); |
| 1570 | #else |
| 1571 | const QString binaryName = QStringLiteral("sh"); |
| 1572 | #endif |
| 1573 | const QString result = Util::findBinaryInPath(binaryName); |
| 1574 | QVERIFY2(!result.isEmpty(), |
| 1575 | "findBinaryInPath should find shell with const QString& arg"); |
| 1576 | QVERIFY2(result.contains(binaryName), |
| 1577 | "Result should contain the binary name"); |
| 1578 | QVERIFY2(QFileInfo(result).isAbsolute(), "Returned path should be absolute"); |
| 1579 | } |
| 1580 | |
| 1581 | void tst_util::findBinaryInPathEmptyString() { |
| 1582 | // Boundary case: passing an empty string should return an empty result |
nothing calls this directly
no outgoing calls
no test coverage detected