| 122 | // --------------------------------------------------------------- |
| 123 | |
| 124 | void switching_nullToFileToProcess() { |
| 125 | // Start with NullProvider |
| 126 | std::unique_ptr<Provider> prov = std::make_unique<NullProvider>(); |
| 127 | QCOMPARE(buildSourceLabel(*prov), QStringLiteral("source\u25BE")); |
| 128 | |
| 129 | // User loads a file |
| 130 | prov = std::make_unique<BufferProvider>(QByteArray(64, '\0'), "game.exe"); |
| 131 | QCOMPARE(buildSourceLabel(*prov), QStringLiteral("'game.exe'\u25BE")); |
| 132 | |
| 133 | // User switches to a "process" -- simulate with a named BufferProvider |
| 134 | // (ProcessProvider needs Windows, but the label logic is the same) |
| 135 | prov = std::make_unique<BufferProvider>(QByteArray(64, '\0'), "notepad.exe"); |
| 136 | // BufferProvider kind is "File", but the switching mechanism works the same |
| 137 | QCOMPARE(prov->kind(), QStringLiteral("File")); |
| 138 | QCOMPARE(prov->name(), QStringLiteral("notepad.exe")); |
| 139 | } |
| 140 | }; |
| 141 | |
| 142 | QTEST_MAIN(TestCommandRow) |
nothing calls this directly
no test coverage detected