Jump to content

Translations:KDevelop5/Manual/Code generation with templates/78/en: Difference between revisions

From KDE Wiki Sandbox
FuzzyBot (talk | contribs)
Importing a new version from external source
 
FuzzyBot (talk | contribs)
Importing a new version from external source
 
Line 1: Line 1:
* testNameOfDriverChanged{{Input|1=<nowiki>void TestBus::testNameOfDriverChanged()
* testNameOfDriverChanged<syntaxhighlight lang="cpp" line>void TestBus::testNameOfDriverChanged()
{
{
     // create spy object
     // create spy object
Line 11: Line 11:
     QCOMPARE(spy1.count(), 1);
     QCOMPARE(spy1.count(), 1);
      
      
}</nowiki>}}
}</syntaxhighlight>

Latest revision as of 08:38, 2 April 2020

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (KDevelop5/Manual/Code generation with templates)
* testNameOfDriverChanged<syntaxhighlight lang="cpp" line>void TestBus::testNameOfDriverChanged()
{
   // create spy object
   QSignalSpy spy1(&m_bus,
                   &Transportation::Bus::nameOfDriverChanged);
   // now change the name of driver
   m_bus.setNameOfDriver(QString("Jim"));
   // verify the check was made
   QVERIFY(m_bus.nameOfDriver() == QString("Jim"));
   // verify the signal was sent
   QCOMPARE(spy1.count(), 1);
    
}</syntaxhighlight>
  • testNameOfDriverChanged
    void TestBus::testNameOfDriverChanged()
    {
        // create spy object
        QSignalSpy spy1(&m_bus,
                        &Transportation::Bus::nameOfDriverChanged);
        // now change the name of driver
        m_bus.setNameOfDriver(QString("Jim"));
        // verify the check was made
        QVERIFY(m_bus.nameOfDriver() == QString("Jim"));
        // verify the signal was sent
        QCOMPARE(spy1.count(), 1);
        
    }