| 46 | } |
| 47 | |
| 48 | void TestMICommandQueue::testDestructor() |
| 49 | { |
| 50 | auto* commandQueue = new KDevMI::MI::CommandQueue; |
| 51 | |
| 52 | // prepare |
| 53 | auto command1 = std::make_unique<TestDummyCommand>(KDevMI::MI::NonMI, QString(), KDevMI::MI::CmdImmediately); |
| 54 | auto command2 = std::make_unique<TestDummyCommand>(KDevMI::MI::NonMI, QString(), KDevMI::MI::CommandFlags {}); |
| 55 | |
| 56 | QSignalSpy command1Spy(command1.get(), &QObject::destroyed); |
| 57 | QSignalSpy command2Spy(command2.get(), &QObject::destroyed); |
| 58 | |
| 59 | commandQueue->enqueue(std::move(command1)); |
| 60 | commandQueue->enqueue(std::move(command2)); |
| 61 | |
| 62 | // execute |
| 63 | delete commandQueue; |
| 64 | |
| 65 | // check |
| 66 | QCOMPARE(command1Spy.count(), 1); |
| 67 | QCOMPARE(command2Spy.count(), 1); |
| 68 | } |
| 69 | |
| 70 | void TestMICommandQueue::addAndTake_data() |
| 71 | { |