| 92 | } |
| 93 | |
| 94 | void 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 | |
| 119 | void TestMICommand::testQObjectCommandHandler() |
| 120 | { |
nothing calls this directly
no test coverage detected