Something went wrong. Try again.
The agentic engineering control plane for the posthuman future
Something went wrong. Try again.
1.1 kB · 39 lines
C++
at main
12345678910111213141516171819202122232425262728293031323334353637383940#include <QtTest>
#include <QCoreApplication>#include <QDir>#include <QFileInfo>
#include "ProcessCwd.h"
class ProcessCwdTest : public QObject { Q_OBJECT
private slots: void selfCwdMatchesCurrentPath(); void bogusPidEmpty(); void zeroAndNegativePidEmpty();};
void ProcessCwdTest::selfCwdMatchesCurrentPath() // NOLINT(readability-convert-member-functions-to-static){ const QString cwd = processCwd(QCoreApplication::applicationPid()); QVERIFY(!cwd.isEmpty()); // Canonicalization absorbs the macOS /tmp -> /private/tmp symlink. QCOMPARE(QFileInfo(cwd).canonicalFilePath(), QFileInfo(QDir::currentPath()).canonicalFilePath());}
void ProcessCwdTest::bogusPidEmpty() // NOLINT(readability-convert-member-functions-to-static){ QCOMPARE(processCwd(999'999'999), QString());}
void ProcessCwdTest::zeroAndNegativePidEmpty() // NOLINT(readability-convert-member-functions-to-static){ QCOMPARE(processCwd(0), QString()); QCOMPARE(processCwd(-1), QString());}
QTEST_MAIN(ProcessCwdTest)#include "tst_processcwd.moc"