phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp
changeset 76 cfea66083b62
parent 65 2a5d4ab426d3
child 78 baacf668fe89
equal deleted inserted replaced
74:d1c62c765e48 76:cfea66083b62
    25 #include "phoneui.hrh"
    25 #include "phoneui.hrh"
    26 #include "tphonecmdparamglobalnote.h"
    26 #include "tphonecmdparamglobalnote.h"
    27 #include "tphonecmdparamquery.h"
    27 #include "tphonecmdparamquery.h"
    28 #include "phoneresourceadapter.h"
    28 #include "phoneresourceadapter.h"
    29 #include "phoneconstants.h"
    29 #include "phoneconstants.h"
    30 
    30 #include "phoneuitestmain.h"
    31 #define PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestObject) \
    31 
    32 int main(int argc, char *argv[]) \
       
    33 { \
       
    34     HbApplication app(argc, argv); \
       
    35     TestObject tc; \
       
    36     QResource::registerResource("../hbcore.rcc"); \
       
    37     int ret = QTest::qExec(&tc, argc, argv); \
       
    38     /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
       
    39     /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
       
    40     /* app.exec() where the signal is normally emitted is not called here. */ \
       
    41     /* So, invoking the signal explicitly. */ \
       
    42     QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
       
    43     return ret; \
       
    44 }
       
    45 
    32 
    46 class TestPhoneNoteController : public QObject
    33 class TestPhoneNoteController : public QObject
    47 {
    34 {
    48     Q_OBJECT
    35     Q_OBJECT
    49 public:
    36 public:
   348     m_noteController->showGlobalNote(&globalNoteParam);
   335     m_noteController->showGlobalNote(&globalNoteParam);
   349     
   336     
   350     QTest::qWait(20000);
   337     QTest::qWait(20000);
   351 }
   338 }
   352 
   339 
   353 PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestPhoneNoteController)
   340 PHONE_UITEST_MAIN(TestPhoneNoteController)
   354 #include "unit_tests.moc"
   341 #include "unit_tests.moc"