commsprocess/commsrootserverconfig/ts_rootserver/RootServerTestSection1.cpp
changeset 72 ae47d0499bee
parent 68 5da8188e392b
child 77 c9776eadbffd
equal deleted inserted replaced
68:5da8188e392b 72:ae47d0499bee
     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 "TestSuiteRootServer.h"
       
    29 #include "RootServerTestSection1.h"
       
    30 
       
    31 
       
    32 // Test step 1.1 - Set MBufPoolSize
       
    33 CRootServerTest1_1::CRootServerTest1_1()
       
    34 {
       
    35 	// store the name of this test case
       
    36 	iTestStepName = _L("Test1.1");
       
    37 }
       
    38 
       
    39 TVerdict CRootServerTest1_1::doTestStepL( void )
       
    40 {
       
    41 	Log(_L("Test Purpose: Set MBufPoolSize"));
       
    42 	Log(_L("Depreciated by PREQ1248."));
       
    43 	return EPass;
       
    44 
       
    45 	}
       
    46 
       
    47 // Test step 1.2 - Test that StartC32() doesnt leak handles.
       
    48 CRootServerTest1_2::CRootServerTest1_2()
       
    49     {
       
    50 	// store the name of this test case
       
    51 	iTestStepName = _L("Test1.2");
       
    52     }
       
    53 
       
    54 TVerdict CRootServerTest1_2::doTestStepL( void )
       
    55     {
       
    56 	Log(_L("Test Purpose: Test that StartC32() doesnt leak handles"));
       
    57 
       
    58     TAutoClose<RThread> thisThread;
       
    59 
       
    60 	//*****************step 1*************************
       
    61 	// Open handle on current thread
       
    62 	Log(_L("01 Open handle on current thread"));
       
    63     TInt result=thisThread.iObj.Open(RThread().Id());
       
    64 	if (KErrNone != result)
       
    65 		{
       
    66 		return EFail;
       
    67 		}
       
    68 
       
    69 	//*****************step 2*************************
       
    70 	// Get handlecount of thread
       
    71 	Log(_L("02 Get handlecount of thread"));
       
    72     TInt threadhandlecount, processhandlecount;
       
    73     thisThread.iObj.HandleCount(processhandlecount, threadhandlecount);
       
    74 
       
    75 	//*****************step 3*************************
       
    76 	// Start comms process
       
    77 	Log(_L("03 Start comms process"));
       
    78  	_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");
       
    79     result = StartC32WithCMISuppressions(KPhbkSyncCMI);
       
    80 	if (KErrNone != result)
       
    81 		{
       
    82 		return EFail;
       
    83 		}
       
    84 
       
    85 	//*****************step 4*************************
       
    86 	// Get handlecount of thread
       
    87 	Log(_L("04 Get handlecount of thread"));
       
    88     TInt threadhandlecount2, processhandlecount2;
       
    89     thisThread.iObj.HandleCount(processhandlecount2, threadhandlecount2);
       
    90 
       
    91 	if (threadhandlecount2!=threadhandlecount)
       
    92 		{
       
    93 		return EFail;
       
    94 		}
       
    95 
       
    96 	return EPass;
       
    97 	}
       
    98 
       
    99