|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "Te_MiscTestStepBase.h" |
|
17 |
|
18 TVerdict CMiscTestStep::doTestStepPreambleL() |
|
19 { |
|
20 __UHEAP_MARK; |
|
21 |
|
22 TInt ret = iTelServer.Connect(); |
|
23 if (ret!=KErrNone) |
|
24 { |
|
25 INFO_PRINTF1(_L("Failed to connect to telephony server")); |
|
26 User::Leave(ret); |
|
27 } |
|
28 ret=iTelServer.LoadPhoneModule(KMmtsyName); |
|
29 if (ret!=KErrNone) |
|
30 { |
|
31 INFO_PRINTF1(_L("Failed to load phone module")); |
|
32 iTelServer.Close(); |
|
33 User::Leave(ret); |
|
34 } |
|
35 ret=iPhone.Open(iTelServer,KPhoneName) ; |
|
36 if (ret!=KErrNone) |
|
37 { |
|
38 INFO_PRINTF1(_L("Failed to open phone module")); |
|
39 iTelServer.UnloadPhoneModule(KMmtsyName); |
|
40 iTelServer.Close(); |
|
41 User::Leave(ret); |
|
42 } |
|
43 // |
|
44 // This test requires a mobile phone to be connected to the serial port |
|
45 // specified in the .cfg file for the initialise below to work |
|
46 // |
|
47 ret=iPhone.Initialise(); |
|
48 if (ret!=KErrNone) |
|
49 { |
|
50 INFO_PRINTF2(_L("Failed to initialise the phone (%d)"), ret); |
|
51 iPhone.Close(); |
|
52 iTelServer.UnloadPhoneModule(KMmtsyName); |
|
53 iTelServer.Close(); |
|
54 User::Leave(ret); |
|
55 } |
|
56 |
|
57 return TestStepResult(); |
|
58 } |
|
59 |
|
60 TVerdict CMiscTestStep::doTestStepPostambleL() |
|
61 { |
|
62 iPhone.Close(); |
|
63 iTelServer.UnloadPhoneModule(KMmtsyName); |
|
64 iTelServer.Close(); |
|
65 |
|
66 __UHEAP_MARKEND; |
|
67 return TestStepResult(); |
|
68 } |