|
1 // Copyright (c) 2007-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 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #include <s32mem.h> |
|
25 #include "temergencycallrf_adaptationplugin_step.h" |
|
26 |
|
27 // |
|
28 // Run the tests |
|
29 // |
|
30 |
|
31 CTestEmergencyCallRfAdaptationPlugin::CTestEmergencyCallRfAdaptationPlugin() |
|
32 :CAdaptationTestBase(KTCTestEmergencyCallRfAdaptationPlugin) |
|
33 { |
|
34 |
|
35 } |
|
36 |
|
37 CTestEmergencyCallRfAdaptationPlugin::~CTestEmergencyCallRfAdaptationPlugin() |
|
38 { |
|
39 |
|
40 } |
|
41 |
|
42 |
|
43 void CTestEmergencyCallRfAdaptationPlugin::TestActivateRfForEmergencyCall() |
|
44 { |
|
45 INFO_PRINTF1(_L(" >CTestEmergencyCallRfAdaptationPlugin::TestActivateRfForEmergencyCall")); |
|
46 |
|
47 //TRequestStatus status; |
|
48 iSsmEmergencyCallRfAdaptation.ActivateRfForEmergencyCall(iStatus); |
|
49 User::WaitForRequest(iStatus); |
|
50 |
|
51 INFO_PRINTF2(_L("CTestEmergencyCallRfAdaptationPlugin::TestActivateRfForEmergencyCall completed with %d error>"), iStatus.Int()); |
|
52 } |
|
53 |
|
54 void CTestEmergencyCallRfAdaptationPlugin::TestDeactivateRfForEmergencyCall() |
|
55 { |
|
56 INFO_PRINTF1(_L(" >CTestEmergencyCallRfAdaptationPlugin::TestDeactivateRfForEmergencyCall")); |
|
57 |
|
58 iSsmEmergencyCallRfAdaptation.DeactivateRfForEmergencyCall(iStatus); |
|
59 User::WaitForRequest(iStatus); |
|
60 |
|
61 INFO_PRINTF2(_L("CTestEmergencyCallRfAdaptationPlugin::TestDeactivateRfForEmergencyCall completed with %d error>"), iStatus.Int()); |
|
62 } |
|
63 |
|
64 void CTestEmergencyCallRfAdaptationPlugin::TestCancel() |
|
65 { |
|
66 INFO_PRINTF1(_L(" >CTestEmergencyCallRfAdaptationPlugin::TestCancel")); |
|
67 iSsmEmergencyCallRfAdaptation.Cancel(); |
|
68 INFO_PRINTF1(_L(" CTestEmergencyCallRfAdaptationPlugin::TestCancel>")); |
|
69 } |
|
70 |
|
71 |
|
72 |
|
73 //from CAdaptationTestBase |
|
74 TVerdict CTestEmergencyCallRfAdaptationPlugin::doTestStepL() |
|
75 { |
|
76 TInt err = KErrNone; |
|
77 |
|
78 __UHEAP_MARK; |
|
79 |
|
80 TRAP(err, TestActivateRfForEmergencyCall()); |
|
81 TEST(iStatus.Int() == KErrDisconnected); |
|
82 TEST(err == KErrNone); |
|
83 TRAP(err, TestDeactivateRfForEmergencyCall()); |
|
84 TEST(err == KErrNone); |
|
85 TEST(iStatus.Int() == KErrDisconnected); |
|
86 |
|
87 User::LeaveIfError(iSsmEmergencyCallRfAdaptation.Connect()); |
|
88 |
|
89 |
|
90 TRAP(err, TestActivateRfForEmergencyCall()); |
|
91 TEST(err == KErrNone); |
|
92 TEST(iStatus.Int() == KErrNone); |
|
93 |
|
94 TRAP(err, TestDeactivateRfForEmergencyCall()); |
|
95 TEST(err == KErrNone); |
|
96 TEST(iStatus.Int() == KErrNone); |
|
97 TestCancel(); |
|
98 //TestRelease(); // have to test this part too ... |
|
99 |
|
100 __UHEAP_MARKEND; |
|
101 |
|
102 return TestStepResult(); |
|
103 } |