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

  • testNameOfDriverChanged
     1 void TestBus::testNameOfDriverChanged()
     2 {
     3     // create spy object
     4     QSignalSpy spy1(&m_bus,
     5                     &Transportation::Bus::nameOfDriverChanged);
     6     // now change the name of driver
     7     m_bus.setNameOfDriver(QString("Jim"));
     8     // verify the check was made
     9     QVERIFY(m_bus.nameOfDriver() == QString("Jim"));
    10     // verify the signal was sent
    11     QCOMPARE(spy1.count(), 1);
    12     
    13 }
    

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.