|
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 "cteststepbtromconfigrsocketserv003.h" |
|
17 #include <es_sock.h> |
|
18 #include <bt_sock.h> |
|
19 #include <bluetoothav.h> |
|
20 |
|
21 CTestStepBtRomConfigRSocketServ003::~CTestStepBtRomConfigRSocketServ003() |
|
22 { |
|
23 } |
|
24 |
|
25 CTestStepBtRomConfigRSocketServ003::CTestStepBtRomConfigRSocketServ003 |
|
26 (CTestServer& aParent) |
|
27 : CTestStepBtRomConfigBase(aParent) |
|
28 { |
|
29 SetTestStepName(KTestNameRSocketServ003); |
|
30 } |
|
31 |
|
32 /** |
|
33 Static Constructor |
|
34 Note the lack of ELeave. This means that having insufficient memory will return NULL; |
|
35 */ |
|
36 CTestStepBtRomConfigRSocketServ003* CTestStepBtRomConfigRSocketServ003::New |
|
37 (CTestServer& aParent) |
|
38 { |
|
39 return new CTestStepBtRomConfigRSocketServ003(aParent); |
|
40 } |
|
41 |
|
42 /** |
|
43 See BT_ROMCONFIG_RSOCKETSERV_003.script |
|
44 */ |
|
45 TVerdict CTestStepBtRomConfigRSocketServ003::doTestStepL() |
|
46 { |
|
47 INFO_PRINTF1(\ |
|
48 _L(">>CTestStepBtRomConfigRSocketServ003::doTestStepL()")); |
|
49 |
|
50 RSocketServ socketServer; |
|
51 TProtocolDesc protocolDesc; |
|
52 User::LeaveIfError(socketServer.Connect()); |
|
53 |
|
54 TUint numProtocols = 0; |
|
55 TBool foundBtProtocol = EFalse; |
|
56 User::LeaveIfError(socketServer.NumProtocols(numProtocols)); |
|
57 |
|
58 for( TUint index = 1; index <= numProtocols ; index++ ) |
|
59 { |
|
60 User::LeaveIfError(socketServer.GetProtocolInfo( index, protocolDesc )); |
|
61 if ( KBTAddrFamily==protocolDesc.iAddrFamily ) |
|
62 { |
|
63 foundBtProtocol = ETrue; |
|
64 INFO_PRINTF2(_L("Found BT protocol %S"), &protocolDesc.iName); |
|
65 } |
|
66 } |
|
67 |
|
68 if ( (foundBtProtocol && iBtExcluded) || (!foundBtProtocol && !iBtExcluded) ) |
|
69 { |
|
70 SetTestStepResult(EFail); |
|
71 } |
|
72 |
|
73 socketServer.Close(); |
|
74 |
|
75 INFO_PRINTF1(\ |
|
76 _L("<<CTestStepBtRomConfigRSocketServ003::doTestStepL()")); |
|
77 CheckAndSetTestResult(); |
|
78 return TestStepResult(); |
|
79 } |
|
80 |
|
81 // EOF |