phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
    57     void cleanupTestCase (); 
    57     void cleanupTestCase (); 
    58     void init ();
    58     void init ();
    59     void cleanup ();
    59     void cleanup ();
    60     
    60     
    61 private slots:
    61 private slots:
    62     void testKeyPressEvents ();
    62     void testKeyPressEvents();
    63     void testKeyReleaseEvents ();
    63     void testKeyReleaseEvents();
    64     void testKeyPressEventsByQtKeys ();
    64     void testKeyPressEventsByQtKeys();
    65     void testLeave ();
    65     void testLeave();
       
    66     void testEndKeyLongPress();
    66 
    67 
    67 
    68 
    68 
    69 
    69 private:
    70 private:
    70     PhoneUIKeyEventAdapter *m_keyadapter; // class under test
    71     PhoneUIKeyEventAdapter *m_keyadapter; // class under test
   198     m_leave = false;
   199     m_leave = false;
   199     
   200     
   200     delete keyEvent;
   201     delete keyEvent;
   201 }
   202 }
   202 
   203 
       
   204 void TestPhoneKeyEventAdapter::testEndKeyLongPress()
       
   205 {
       
   206     m_keyadapter->endKeyLongPress();
       
   207     QCOMPARE((int)m_eventCode, EEventLongPress);
       
   208     QCOMPARE(m_scan_code, (int)EKeyNo);
       
   209     QCOMPARE(m_code, (int)EKeyNo);
       
   210     QCOMPARE(m_repeats, 0);
       
   211 }
       
   212 
   203 PHONE_QT_TEST_MAIN(TestPhoneKeyEventAdapter)
   213 PHONE_QT_TEST_MAIN(TestPhoneKeyEventAdapter)
   204 #include "unit_tests.moc"
   214 #include "unit_tests.moc"