Conversation
WalkthroughThree new integration test methods have been added to the dummy adapter test suite to validate register read operations, repeated read cycles, and stop session signal emission. The test header declarations and corresponding implementations were added with supporting configuration for TCP connections. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/integration/tst_dummyadapter.cpp (1)
176-215: Consider assertingsessionErrorin the remaining new tests for clearer diagnostics.
multipleReadCyclesAllSucceed()andstopSessionEmitsSessionStopped()currently verify success signals but do not explicitly rule out concurrentsessionErroremissions.Suggested patch
void TestDummyAdapter::multipleReadCyclesAllSucceed() { auto* process = new AdapterProcess(); AdapterClient client(process); @@ connect(&client, &AdapterClient::describeResult, &client, [&client, ®isters]() { client.provideConfig(realConfig(), registers); }); QSignalSpy spyStarted(&client, &AdapterClient::sessionStarted); + QSignalSpy spyError(&client, &AdapterClient::sessionError); client.prepareAdapter(QString::fromUtf8(DUMMY_ADAPTER_EXECUTABLE)); QVERIFY2(spyStarted.wait(cSessionTimeoutMs), "sessionStarted not emitted"); + QCOMPARE(spyError.count(), 0); @@ client.stopSession(); } void TestDummyAdapter::stopSessionEmitsSessionStopped() { @@ connect(&client, &AdapterClient::describeResult, &client, [&client]() { client.provideConfig(realConfig(), QStringList()); }); QSignalSpy spyStarted(&client, &AdapterClient::sessionStarted); + QSignalSpy spyError(&client, &AdapterClient::sessionError); client.prepareAdapter(QString::fromUtf8(DUMMY_ADAPTER_EXECUTABLE)); QVERIFY2(spyStarted.wait(cSessionTimeoutMs), "sessionStarted not emitted"); + QCOMPARE(spyError.count(), 0); QSignalSpy spyStopped(&client, &AdapterClient::sessionStopped); client.stopSession(); QVERIFY2(spyStopped.wait(cSessionTimeoutMs), "sessionStopped not emitted after stopSession"); + QCOMPARE(spyError.count(), 0); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/integration/tst_dummyadapter.cpp` around lines 176 - 215, Add assertions that AdapterClient::sessionError is not emitted in both tests: create a QSignalSpy spyError(&client, &AdapterClient::sessionError) before starting the session in multipleReadCyclesAllSucceed() and stopSessionEmitsSessionStopped(), then after each asynchronous wait (after spyStarted.wait, after each spyData.wait in multipleReadCyclesAllSucceed, and after spyStopped.wait in stopSessionEmitsSessionStopped) assert spyError.count() == 0 (or QVERIFY2(spyError.isEmpty(), "sessionError emitted")) to fail fast if an error was raised concurrently; use the existing cSessionTimeoutMs/cReadTimeoutMs time windows when verifying outcomes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/integration/tst_dummyadapter.cpp`:
- Around line 176-215: Add assertions that AdapterClient::sessionError is not
emitted in both tests: create a QSignalSpy spyError(&client,
&AdapterClient::sessionError) before starting the session in
multipleReadCyclesAllSucceed() and stopSessionEmitsSessionStopped(), then after
each asynchronous wait (after spyStarted.wait, after each spyData.wait in
multipleReadCyclesAllSucceed, and after spyStopped.wait in
stopSessionEmitsSessionStopped) assert spyError.count() == 0 (or
QVERIFY2(spyError.isEmpty(), "sessionError emitted")) to fail fast if an error
was raised concurrently; use the existing cSessionTimeoutMs/cReadTimeoutMs time
windows when verifying outcomes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: afe28601-63d6-4e0f-a593-51049aa827d4
📒 Files selected for processing (2)
tests/integration/tst_dummyadapter.cpptests/integration/tst_dummyadapter.h
Summary by CodeRabbit