diff -r d1c62c765e48 -r cfea66083b62 phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/unit_tests.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/unit_tests.cpp Fri Sep 17 17:09:12 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/unit_tests.cpp Mon Oct 04 16:06:10 2010 +0300 @@ -29,6 +29,7 @@ #include "phoneresourceids.h" #include "phoneresourceadapter.h" #include "phoneuiqtbuttonscontroller.h" +#include "phonetestmain.h" extern bool m_setActions; extern bool m_setInvalidCommand; @@ -38,21 +39,6 @@ extern bool m_setCustomToolBarCommands; extern int m_phoneButtonFlags; -#define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \ -int main(int argc, char *argv[]) \ - { \ - HbApplication app(argc, argv); \ - TestObject tc; \ - QResource::registerResource("../hbcore.rcc"); \ - int ret = QTest::qExec(&tc, argc, argv); \ - /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \ - /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \ - /* app.exec() where the signal is normally emitted is not called here. */ \ - /* So, invoking the signal explicitly. */ \ - QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \ - return ret; \ - } - class TestPhoneUiCommandController : public QObject, public PhoneUIQtViewIF, public BubbleManagerIF { @@ -95,7 +81,7 @@ void setMenuActions(const QList& ) { m_setMenuActionsCalled = true;}; void shutdownPhoneApp() {}; void setBackButtonVisible(bool ) {}; - HbMenu &menuReference(){return m_menu;}; + HbMenu &menuReference(){ HbMenu* menu = NULL; return *menu;}; void captureKey(Qt::Key , bool ) {}; // From BubbleManagerIF @@ -200,8 +186,6 @@ bool m_setMenuActionsCalled; bool m_isDialpadVisible; QString m_dialpadText; - HbMenu m_menu; - }; TestPhoneUiCommandController::TestPhoneUiCommandController () @@ -826,5 +810,5 @@ QVERIFY(4==actions.count()); } -PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUiCommandController) +PHONE_TEST_MAIN(TestPhoneUiCommandController) #include "unit_tests.moc"