|
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: Implementation of the Mt_UssdSat class |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <cphcltussdsatclient.h> |
|
19 #include <etelsat.h> |
|
20 #include "mt_ussdsat.h" |
|
21 |
|
22 /*------------------------------------------------------------------------------ |
|
23 This module testing project links to phoneclient.dll. |
|
24 ------------------------------------------------------------------------------*/ |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // Mt_UssdSat::Mt_UssdSat |
|
28 // Default constructor, remember to null new members here. |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 Mt_UssdSat::Mt_UssdSat():mUssdSat(NULL) |
|
32 { |
|
33 qDebug("Mt_UssdSat in-out"); |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // Mt_UssdSat::~Mt_UssdSat |
|
38 // ----------------------------------------------------------------------------- |
|
39 Mt_UssdSat::~Mt_UssdSat() |
|
40 { |
|
41 qDebug("~Mt_UssdSat in-out"); |
|
42 } |
|
43 |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // Mt_UssdSat::initTestCase |
|
47 // QTestLib initialization method, called for each test case. |
|
48 // ----------------------------------------------------------------------------- |
|
49 void Mt_UssdSat::initTestCase() |
|
50 { |
|
51 qDebug("initTestCase in"); |
|
52 mUssdSat = CPhCltUssdSatClient::NewL( EFalse ); |
|
53 qDebug("initTestCase out"); |
|
54 } |
|
55 |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // Mt_UssdSat::cleanupTestCase |
|
59 // QTestLib cleanup method, called for each test case. |
|
60 // ----------------------------------------------------------------------------- |
|
61 void Mt_UssdSat::cleanupTestCase() |
|
62 { |
|
63 qDebug("cleanupTestCase in"); |
|
64 delete mUssdSat; |
|
65 qDebug("cleanupTestCase out"); |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // Mt_UssdSat::testSendSatMessage |
|
70 // ----------------------------------------------------------------------------- |
|
71 void Mt_UssdSat::testSendSatMessage() |
|
72 { |
|
73 qDebug("testSendSatMessage in"); |
|
74 |
|
75 _LIT( KUssdSat, "*100#"); // valid for BTN |
|
76 |
|
77 TBuf<RSat::KStringMaxSize> receiveMessage; |
|
78 TBool sendCompletedFirst( EFalse ); |
|
79 TUint8 receiveDcs = 0; |
|
80 |
|
81 TInt ret = mUssdSat->SendSatMessage( |
|
82 KUssdSat, |
|
83 CPhCltUssdSatClient::EPhCltDcsUnknown, |
|
84 receiveMessage, |
|
85 sendCompletedFirst, |
|
86 receiveDcs ); |
|
87 |
|
88 qDebug("receive error=%d", ret); |
|
89 qDebug("receive receive msg=%s", &receiveMessage); |
|
90 qDebug("receive isCompleteFirst=%d", &sendCompletedFirst); |
|
91 qDebug("receive receive Dcs=%d", &receiveDcs); |
|
92 |
|
93 QVERIFY2(KErrNone == ret , "testSendSatMessage failed "); |
|
94 qDebug("testSendSatMessage out"); |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // Mt_UssdSat::testSendSatMessageCancel |
|
99 // ----------------------------------------------------------------------------- |
|
100 void Mt_UssdSat::testSendSatMessageCancel() |
|
101 { |
|
102 qDebug("testSendSatMessageCancel in"); |
|
103 |
|
104 mUssdSat->SendSatMessageCancel(); |
|
105 |
|
106 qDebug("testSendSatMessageCancel out"); |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // main() |
|
111 // Main method implemented for directing test output to a file. |
|
112 // ----------------------------------------------------------------------------- |
|
113 int main(int argc, char *argv[]) |
|
114 { |
|
115 qDebug("main() in"); |
|
116 QApplication app(argc, argv); |
|
117 |
|
118 qDebug("Start testing..."); |
|
119 Mt_UssdSat tc; |
|
120 char *pass[3]; |
|
121 pass[0] = argv[0]; |
|
122 pass[1] = "-o"; |
|
123 pass[2] = "c:\\logs\\mt_ussdsat.txt"; |
|
124 const int result = QTest::qExec(&tc, 3, pass); |
|
125 qDebug("End testing..."); |
|
126 |
|
127 qDebug("main() out, result=%d", result); |
|
128 return result; |
|
129 } |
|
130 |
|
131 //End file |