72
|
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 |
// This contains ESock Test cases from section 1
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
// EPOC includes
|
|
19 |
#include <e32base.h>
|
|
20 |
#include <es_mbman.h>
|
|
21 |
|
|
22 |
// Test system includes
|
|
23 |
//#include <networking/log.h>
|
|
24 |
//#include <networking/teststep.h>
|
|
25 |
//#include <networking/testsuite.h>
|
|
26 |
|
|
27 |
#include "TestStepRootServer.h"
|
|
28 |
#include "RootServerTestSection1.h"
|
|
29 |
|
|
30 |
|
|
31 |
// Test step 1.1 - Set MBufPoolSize
|
|
32 |
CRootServerTest1_1::CRootServerTest1_1(CTE_RootServerServer *aSuite) : CTestStepRootServer(aSuite)
|
|
33 |
{
|
|
34 |
// store the name of this test case
|
|
35 |
SetTestStepName(_L("Test1.1"));
|
|
36 |
}
|
|
37 |
|
|
38 |
TVerdict CRootServerTest1_1::doTestStepL( void )
|
|
39 |
{
|
|
40 |
INFO_PRINTF1(_L("Test Purpose: Set MBufPoolSize"));
|
|
41 |
INFO_PRINTF1(_L("Depreciated by PREQ1248."));
|
|
42 |
|
|
43 |
SetTestStepResult(EPass);
|
|
44 |
|
|
45 |
return TestStepResult();
|
|
46 |
}
|
|
47 |
|
|
48 |
// Test step 1.2 - Test that StartC32() doesnt leak handles.
|
|
49 |
CRootServerTest1_2::CRootServerTest1_2(CTE_RootServerServer *aSuite) : CTestStepRootServer(aSuite)
|
|
50 |
{
|
|
51 |
// store the name of this test case
|
|
52 |
SetTestStepName(_L("Test1.2"));
|
|
53 |
}
|
|
54 |
|
|
55 |
TVerdict CRootServerTest1_2::doTestStepL( void )
|
|
56 |
{
|
|
57 |
SetTestStepResult(EFail);
|
|
58 |
INFO_PRINTF1(_L("Test Purpose: Test that StartC32() doesnt leak handles"));
|
|
59 |
|
|
60 |
TAutoClose<RThread> thisThread;
|
|
61 |
|
|
62 |
//*****************step 1*************************
|
|
63 |
// Open handle on current thread
|
|
64 |
INFO_PRINTF1(_L("01 Open handle on current thread"));
|
|
65 |
TInt result=thisThread.iObj.Open(RThread().Id());
|
|
66 |
if (KErrNone != result)
|
|
67 |
{
|
|
68 |
SetTestStepResult(EFail);
|
|
69 |
|
|
70 |
return TestStepResult();
|
|
71 |
}
|
|
72 |
|
|
73 |
//*****************step 2*************************
|
|
74 |
// Get handlecount of thread
|
|
75 |
INFO_PRINTF1(_L("02 Get handlecount of thread"));
|
|
76 |
TInt threadhandlecount, processhandlecount;
|
|
77 |
thisThread.iObj.HandleCount(processhandlecount, threadhandlecount);
|
|
78 |
|
|
79 |
//*****************step 3*************************
|
|
80 |
// Start comms process
|
|
81 |
INFO_PRINTF1(_L("03 Start comms process"));
|
|
82 |
_LIT(KPhbkSyncCMI, "phbsync.cmi, c32.cmi, etel.cmi, esock.cmi, esock_main.cmi, esock_codealer1.cmi, esock_codealer2.cmi, esock_ip.cmi, esock_mip.cmi, esock_dip.cmi, esock_tr.cmi, esock_ir.cmi, esock_bt.cmi, esock_smswap.cmi, esock_pdummy1.cmi, esock_pdummy2.cmi, esock_ipc.cmi, esock_sip.cmi");
|
|
83 |
result = StartC32WithCMISuppressions(KPhbkSyncCMI);
|
|
84 |
if (KErrNone != result)
|
|
85 |
{
|
|
86 |
SetTestStepResult(EFail);
|
|
87 |
return TestStepResult();
|
|
88 |
}
|
|
89 |
|
|
90 |
//*****************step 4*************************
|
|
91 |
// Get handlecount of thread
|
|
92 |
INFO_PRINTF1(_L("04 Get handlecount of thread"));
|
|
93 |
TInt threadhandlecount2, processhandlecount2;
|
|
94 |
thisThread.iObj.HandleCount(processhandlecount2, threadhandlecount2);
|
|
95 |
|
|
96 |
if (threadhandlecount2!=threadhandlecount)
|
|
97 |
{
|
|
98 |
SetTestStepResult(EFail);
|
|
99 |
return TestStepResult();
|
|
100 |
}
|
|
101 |
|
|
102 |
SetTestStepResult(EPass);
|
|
103 |
|
|
104 |
return TestStepResult();
|
|
105 |
}
|
|
106 |
|