|
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 "cteststepbtromconfiguser004.h" |
|
17 #include <es_sock.h> |
|
18 #include <bt_sock.h> |
|
19 |
|
20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
21 #include <bthci.h> |
|
22 #endif |
|
23 |
|
24 CTestStepBtRomConfigUser004::~CTestStepBtRomConfigUser004() |
|
25 { |
|
26 } |
|
27 |
|
28 CTestStepBtRomConfigUser004::CTestStepBtRomConfigUser004 |
|
29 (CTestServer& aParent) |
|
30 : CTestStepBtRomConfigBase(aParent) |
|
31 { |
|
32 SetTestStepName(KTestNameUser004); |
|
33 } |
|
34 |
|
35 /** |
|
36 Static Constructor |
|
37 Note the lack of ELeave. This means that having insufficient memory will return NULL; |
|
38 */ |
|
39 CTestStepBtRomConfigUser004* CTestStepBtRomConfigUser004::New |
|
40 (CTestServer& aParent) |
|
41 { |
|
42 return new CTestStepBtRomConfigUser004(aParent); |
|
43 } |
|
44 |
|
45 /** |
|
46 See BT_ROMCONFIG_USER_004.script |
|
47 */ |
|
48 TVerdict CTestStepBtRomConfigUser004::doTestStepL() |
|
49 { |
|
50 INFO_PRINTF1(\ |
|
51 _L(">>CTestStepBtRomConfigUser004::doTestStepL()")); |
|
52 RSocketServ socketServer; |
|
53 User::LeaveIfError( socketServer.Connect() ); |
|
54 |
|
55 const TInt expectedError = ( iBtExcluded ? KErrBadName : KErrNone ); |
|
56 // this is only used for logging readability purposes |
|
57 const TDesC* expectedErrorDesPtr = ( iBtExcluded ? &KErrBadNameLit : &KErrNoneLit ); |
|
58 |
|
59 RHCIDirectAccess access; |
|
60 TInt err = access.Open(socketServer); |
|
61 if ( err!=expectedError ) |
|
62 { |
|
63 INFO_PRINTF4(\ |
|
64 _L("Failed: Expected %S(%d) and got %d calling RHCIDirectAccess::Open"), |
|
65 expectedErrorDesPtr, expectedError, err); |
|
66 SetTestStepResult(EFail); |
|
67 } |
|
68 |
|
69 if ( access.SubSessionHandle() ) |
|
70 { |
|
71 access.Close(); |
|
72 } |
|
73 socketServer.Close(); |
|
74 |
|
75 INFO_PRINTF1(\ |
|
76 _L("<<CTestStepBtRomConfigUser004::doTestStepL()")); |
|
77 CheckAndSetTestResult(); |
|
78 return TestStepResult(); |
|
79 } |
|
80 |
|
81 // EOF |