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 //USER |
|
19 #include "lcapplication.h" |
|
20 #include "ut_lcapplication.h" |
|
21 |
|
22 #include <QtTest/QtTest> |
|
23 |
|
24 |
|
25 void UT_LcApplication::initTestCase() |
|
26 { |
|
27 } |
|
28 |
|
29 void UT_LcApplication::cleanupTestCase() |
|
30 { |
|
31 } |
|
32 |
|
33 |
|
34 void UT_LcApplication::init() |
|
35 { |
|
36 mArgc = 0; |
|
37 mLcApplication = new LcHbApplication( mArgc, 0 ); |
|
38 } |
|
39 |
|
40 void UT_LcApplication::cleanup() |
|
41 { |
|
42 delete mLcApplication; |
|
43 } |
|
44 |
|
45 void UT_LcApplication::testConstructorDestructor() |
|
46 { |
|
47 QVERIFY( mLcApplication ); |
|
48 QVERIFY( LcHbApplication::self == mLcApplication ); |
|
49 |
|
50 delete mLcApplication; |
|
51 mLcApplication = 0; |
|
52 QVERIFY( !LcHbApplication::self ); |
|
53 } |
|
54 |
|
55 void UT_LcApplication::testQuit() |
|
56 { |
|
57 QSignalSpy spy( mLcApplication, SIGNAL(handleQuit()) ); |
|
58 LcHbApplication::quit(); |
|
59 QCOMPARE( spy.count(), 1 ); |
|
60 |
|
61 mLcApplication->self = 0; |
|
62 spy.clear(); |
|
63 LcHbApplication::quit(); |
|
64 QCOMPARE( spy.count(), 0 ); |
|
65 } |
|