telutils/dialpad/tsrc/unit/shared/dialpadtest.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALPADTEST_H
       
    19 #define DIALPADTEST_H
       
    20 
       
    21 #include <QtCore>
       
    22 
       
    23 #define DIALPAD_TEST_MAIN(TestObject) \
       
    24 int main(int argc, char *argv[]) \
       
    25 { \
       
    26     HbApplication app(argc, argv); \
       
    27     TestObject tc; \
       
    28     QResource::registerResource("../hbcore.rcc"); \
       
    29     int ret = QTest::qExec(&tc, argc, argv); \
       
    30     /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
       
    31     /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
       
    32     /* app.exec() where the signal is normally emitted is not called here. */ \
       
    33     /* So, invoking the signal explicitly. */ \
       
    34     QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
       
    35     return ret; \
       
    36 }
       
    37 
       
    38 #endif // DIALPADTEST_H