|
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 "cteststepbtromconfigremcon001.h" |
|
17 #include <remconinterfaceselector.h> |
|
18 #include <remconcoreapicontroller.h> |
|
19 |
|
20 CTestStepBtRomConfigRemCon001::~CTestStepBtRomConfigRemCon001() |
|
21 { |
|
22 } |
|
23 |
|
24 CTestStepBtRomConfigRemCon001::CTestStepBtRomConfigRemCon001 |
|
25 (CTestServer& aParent) |
|
26 : CTestStepBtRomConfigBase(aParent) |
|
27 { |
|
28 SetTestStepName(KTestNameRemCon001); |
|
29 } |
|
30 |
|
31 /** |
|
32 Static Constructor |
|
33 Note the lack of ELeave. This means that having insufficient memory will return NULL; |
|
34 */ |
|
35 CTestStepBtRomConfigRemCon001* CTestStepBtRomConfigRemCon001::New |
|
36 (CTestServer& aParent) |
|
37 { |
|
38 return new CTestStepBtRomConfigRemCon001(aParent); |
|
39 } |
|
40 |
|
41 /** |
|
42 See BT_ROMCONFIG_REMCON_001.script |
|
43 */ |
|
44 TVerdict CTestStepBtRomConfigRemCon001::doTestStepL() |
|
45 { |
|
46 INFO_PRINTF1(\ |
|
47 _L(">>CTestStepBtRomConfigRemCon001::doTestStepL()")); |
|
48 |
|
49 CActiveScheduler* sched = new (ELeave)CActiveScheduler; |
|
50 CActiveScheduler::Install(sched); |
|
51 CleanupStack::PushL(sched); |
|
52 |
|
53 CRemConInterfaceSelector* remconSelector = CRemConInterfaceSelector::NewL(); |
|
54 CleanupStack::PushL( remconSelector ); |
|
55 |
|
56 CRemConCoreApiController* cont = CRemConCoreApiController::NewL(*remconSelector, *this); |
|
57 // ownership of cont is with remconSelector now |
|
58 |
|
59 const TInt expectedError = ( iBtExcluded ? KErrNotFound : KErrNone ); |
|
60 // this is only used for logging readability purposes |
|
61 const TDesC* expectedErrorDesPtr = ( iBtExcluded ? &KErrNotFoundLit : &KErrNoneLit ); |
|
62 |
|
63 TRAPD(err, remconSelector->OpenControllerL()) |
|
64 if ( err!=expectedError ) |
|
65 { |
|
66 INFO_PRINTF4(\ |
|
67 _L("Failed: Expected %S(%d) and got %d when calling CRemConInterfaceSelector::OpenControllerL"),\ |
|
68 expectedErrorDesPtr, expectedError, err); |
|
69 SetTestStepResult(EFail); |
|
70 } |
|
71 |
|
72 CleanupStack::PopAndDestroy(remconSelector); |
|
73 CleanupStack::PopAndDestroy(sched); |
|
74 INFO_PRINTF1(\ |
|
75 _L("<<CTestStepBtRomConfigRemCon001::doTestStepL()")); |
|
76 CheckAndSetTestResult(); |
|
77 return TestStepResult(); |
|
78 } |
|
79 |
|
80 // stubs |
|
81 void CTestStepBtRomConfigRemCon001::MrccacoResponse(TRemConCoreApiOperationId /*aOperationId*/, TInt /*aError*/) |
|
82 { |
|
83 } |
|
84 |
|
85 // EOF |