|
1 /* |
|
2 * Copyright (c) 2010 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:Unit testing of SatApp |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <QtTest/QtTest> |
|
21 #include "hbapplication.h" |
|
22 #include "hbinstance.h" |
|
23 |
|
24 #include "ut_satappmainhandler.h" |
|
25 #include "ut_satappmenuprovider.h" |
|
26 #include "ut_satappinputprovider.h" |
|
27 #include "ut_satapptoneprovider.h" |
|
28 #include "ut_satapppopupprovider.h" |
|
29 #include "ut_satappserverdispatcher.h" |
|
30 #include "ut_satappconfirmprovider.h" |
|
31 #include "ut_satappaction.h" |
|
32 |
|
33 int main(int argc, char *argv[]) |
|
34 { |
|
35 qDebug("Ut_SatApp: main() >"); |
|
36 HbApplication app(argc,argv); |
|
37 HbInstance::instance(); |
|
38 HbMainWindow mainWindow; |
|
39 |
|
40 // test cmdline parameters |
|
41 char *pass[3]; |
|
42 pass[0] = argv[0]; |
|
43 pass[1] = "-o"; |
|
44 |
|
45 int result(0); |
|
46 |
|
47 Ut_SatAppPopupProvider utPopupProvider; |
|
48 pass[2] = "c:\\logs\\sat\\Ut_SatAppPopupProvider.txt"; |
|
49 result += QTest::qExec(&utPopupProvider, /*3*/ 1, pass); |
|
50 |
|
51 Ut_SatAppConfirmProvider utConfirmProvide; |
|
52 pass[2] = "c:\\logs\\sat\\Ut_SatAppConfirmProvider.txt"; |
|
53 result += QTest::qExec(&utConfirmProvide, /*3*/ 1, pass); |
|
54 |
|
55 Ut_SatAppAction utAction; |
|
56 pass[2] = "c:\\logs\\sat\\Ut_SatAppAction.txt"; |
|
57 result += QTest::qExec(&utAction, /*3*/ 1, pass); |
|
58 |
|
59 Ut_SatAppMenuProvider utMenuProvider(&mainWindow); |
|
60 pass[2] = "c:\\logs\\sat\\Ut_SatAppMenuProvider.txt"; |
|
61 result += QTest::qExec(&utMenuProvider, /*3*/ 1, pass); |
|
62 |
|
63 Ut_SatAppInputProvider utInputProvider; |
|
64 pass[2] = "c:\\logs\\sat\\Ut_SatAppInputProvider.txt"; |
|
65 result += QTest::qExec(&utInputProvider, /*3*/ 1, pass); |
|
66 |
|
67 Ut_SatAppToneProvider utToneProvider; |
|
68 pass[2] = "c:\\logs\\sat\\Ut_SatAppToneProvider.txt"; |
|
69 result += QTest::qExec(&utToneProvider, /*3*/ 1, pass); |
|
70 |
|
71 Ut_SatAppServerDispatcher utServerDispatcher; |
|
72 pass[2] = "c:\\logs\\sat\\Ut_SatAppServerDispatcher.txt"; |
|
73 result += QTest::qExec(&utServerDispatcher, /*3*/ 1, pass); |
|
74 |
|
75 Ut_SatAppMainHandler utMainHandler(&mainWindow); |
|
76 pass[2] = "c:\\logs\\sat\\ut_SatAppMainHandler.txt"; |
|
77 result = QTest::qExec(&utMainHandler, /*3*/ 1, pass); |
|
78 |
|
79 // cause a crash to free binary, so that we can recompile and run |
|
80 // unit tests without restarting the emulator |
|
81 //int crash = ((QString*)0)->length(); |
|
82 return result; |
|
83 } |
|
84 |
|
85 //End of file |