Revision as of 11:04, 7 April 2020 by Claus chr (talk | contribs) (Created page with "* testNumberOfPassengersChanged<syntaxhighlight lang="cpp" line>void TestBus::testNumberOfPassengersChanged() { // create spy object QSignalSpy spy1(&m_bus,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Translations:KDevelop5/Manual/Code generation with templates/77/da

  • testNumberOfPassengersChanged
     1 void TestBus::testNumberOfPassengersChanged()
     2 {
     3     // create spy object
     4     QSignalSpy spy1(&m_bus,
     5                     &Transportation::Bus::numberOfPassengersChanged);
     6     // now change the number of passengers
     7     m_bus.setNumberOfPassengers(4);
     8     // verify the check was made
     9     QVERIFY(m_bus.numberOfPassengers() == 4);
    10     // verify the signal was sent
    11     QCOMPARE(spy1.count(), 1);
    12 }
    

This page was last edited on 7 April 2020, at 11:04. Content is available under Creative Commons License SA 4.0 unless otherwise noted.