|
1 // Copyright (c) 2003-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 // __ACTION_INFO_BEGIN__ |
|
15 // [Action Name] |
|
16 // InitNtRas |
|
17 // [Action Parameters] |
|
18 // none |
|
19 // [Action Description] |
|
20 // Creates the serial drivers required by NTRAS. |
|
21 // [APIs Used] |
|
22 // none |
|
23 // __ACTION_INFO_END__ |
|
24 // |
|
25 // |
|
26 |
|
27 /** |
|
28 @file |
|
29 */ |
|
30 |
|
31 |
|
32 #include "CMtfTestActionInitNtRas.h" |
|
33 #include "CMtfTestCase.h" |
|
34 #include "CMtfTestActionParameters.h" |
|
35 |
|
36 #if defined (__WINS__) |
|
37 #define PDD_NAME _L("ECDRV") |
|
38 #define LDD_NAME _L("ECOMM") |
|
39 #else |
|
40 #define PDD_NAME _L("EUART1") |
|
41 #define LDD_NAME _L("ECOMM") |
|
42 #endif |
|
43 |
|
44 |
|
45 CMtfTestAction* CMtfTestActionInitNtRas::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
46 { |
|
47 CMtfTestActionInitNtRas* self = new (ELeave) CMtfTestActionInitNtRas(aTestCase); |
|
48 CleanupStack::PushL(self); |
|
49 self->ConstructL(aActionParameters); |
|
50 CleanupStack::Pop(); |
|
51 return self; |
|
52 } |
|
53 |
|
54 |
|
55 CMtfTestActionInitNtRas::CMtfTestActionInitNtRas(CMtfTestCase& aTestCase) |
|
56 : CMtfSynchronousTestAction(aTestCase) |
|
57 { |
|
58 } |
|
59 |
|
60 |
|
61 CMtfTestActionInitNtRas::~CMtfTestActionInitNtRas() |
|
62 { |
|
63 } |
|
64 |
|
65 |
|
66 void CMtfTestActionInitNtRas::ExecuteActionL() |
|
67 { |
|
68 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionInitNtRas); |
|
69 TInt driverErr; |
|
70 driverErr=User::LoadPhysicalDevice(PDD_NAME); |
|
71 if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists) |
|
72 User::Leave(driverErr); |
|
73 driverErr=User::LoadLogicalDevice(LDD_NAME); |
|
74 if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists) |
|
75 User::Leave(driverErr); |
|
76 |
|
77 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionInitNtRas); |
|
78 TestCase().ActionCompletedL(*this); |
|
79 } |
|
80 |