MCPcopy Create free account
hub / github.com/IJHack/QtPass / findBinaryInPathWithConstQStringRef

Method findBinaryInPathWithConstQStringRef

tests/auto/util/tst_util.cpp:1565–1579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1563// const-qualified variables continue to work correctly.
1564
1565void 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
1581void tst_util::findBinaryInPathEmptyString() {
1582 // Boundary case: passing an empty string should return an empty result

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected