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

Method testDestructor

plugins/debuggercommon/tests/test_micommandqueue.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void 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
70void TestMICommandQueue::addAndTake_data()
71{

Callers

nothing calls this directly

Calls 4

enqueueMethod · 0.80
QStringClass · 0.50
getMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected