MCPcopy Create free account
hub / github.com/KDE/kdevelop / testMICommandHandler

Method testMICommandHandler

plugins/debuggercommon/tests/test_micommand.cpp:94–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void TestMICommand::testMICommandHandler()
95{
96 KDevMI::MI::UserCommand command(KDevMI::MI::NonMI, "command");
97 command.setToken(1);
98
99 // set handle and invoke
100 QPointer<TestCommandHandler> commandHandler = new TestCommandHandler(1);
101 command.setHandler(commandHandler);
102
103 KDevMI::MI::ResultRecord resultRecord1("reason");
104 bool success = command.invokeHandler(resultRecord1);
105
106 // check
107 QVERIFY(success);
108 QCOMPARE(commandHandler, nullptr);
109
110 // try to invoke again without handler
111 // ensure handler no longer exists
112 KDevMI::MI::ResultRecord resultRecord2("reason");
113 success = command.invokeHandler(resultRecord2);
114
115 // check
116 QVERIFY(!success);
117}
118
119void TestMICommand::testQObjectCommandHandler()
120{

Callers

nothing calls this directly

Calls 3

setTokenMethod · 0.80
setHandlerMethod · 0.60
invokeHandlerMethod · 0.45

Tested by

no test coverage detected