commsfwutils/commsbufs/TS_mbufmgr/test16memoryfull.h
changeset 72 ae47d0499bee
parent 68 5da8188e392b
child 77 c9776eadbffd
equal deleted inserted replaced
68:5da8188e392b 72:ae47d0499bee
     1 // Copyright (c) 2002-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 // Contains declaration of test 16
       
    15 // 
       
    16 //
       
    17 
       
    18 #if (!defined __TEST16MEMORYFULL_H__)
       
    19 #define __TEST16MEMORYFULL_H__
       
    20 
       
    21 #include <cflog.h>
       
    22 #include <es_mbuf.h>
       
    23 
       
    24 static const TInt KFactor = 10;
       
    25 static const TInt KFactor1 = 9;
       
    26 static const TInt KFactor2 = 8;
       
    27 static const TInt KFactor3 = 7;
       
    28 
       
    29 class RCommsBufPond;
       
    30 class RMBufAsyncRequest;
       
    31 
       
    32 
       
    33 NONSHARABLE_CLASS(CTest16MemoryFull) : public CTestStepCTMbufmgr
       
    34 {
       
    35 public:
       
    36 	CTest16MemoryFull();
       
    37 	~CTest16MemoryFull();
       
    38 	virtual enum TVerdict doTestStepL( void );
       
    39 	TInt iMainThreadTries;
       
    40 	TInt iMainThreadFails;
       
    41 	TInt iMainThreadSizeFails;
       
    42 	TInt iMainThreadLastFailure;
       
    43 	TInt iThread1AllocTries, iThread2AllocTries, iThread3Tries;
       
    44 	TInt iThread1MemoryFull, iThread2MemoryFull, iThread3AllocFails;
       
    45 	TInt iThread1SizeFails, iThread2SizeFails, iThread3Fails;
       
    46 	TInt iThread1LastMemoryFull, iThread2LastMemoryFull;
       
    47 	TInt iThread1MaxLen, iThread2MaxLen, iThread3MaxLen;
       
    48 	TUint iThread1AllocTime, iThread1FreeTime;
       
    49 	TUint iThread2AllocTime, iThread2FreeTime;
       
    50 	TInt iAllocatedMemory;
       
    51 	TAny* iNotifierAllocator;
       
    52 
       
    53 	void FillDes(TDes8 &aBuf, TInt aStartPos, TInt anEndPos, TUint aStartChar, TUint anEndChar);
       
    54 	RCommsBufPond& BufPond(); 
       
    55 
       
    56 };	
       
    57 
       
    58 NONSHARABLE_CLASS(CMBufAsyncMemFull) : public CActive
       
    59 {
       
    60 public:
       
    61 	CMBufAsyncMemFull(CTest16MemoryFull* aTestObject,
       
    62 				RMBufAsyncRequest& aMBufAsyncReq, 
       
    63 				TDes8 *aDes1, 
       
    64 				TDes8 *aDes2);
       
    65 
       
    66 	~CMBufAsyncMemFull() { Cancel(); }
       
    67 
       
    68 	void RunL();
       
    69 
       
    70 	void DoCancel()  { iMBufAsyncReq.Cancel(); }
       
    71 
       
    72 	TInt DoStartTest();
       
    73 
       
    74 private:
       
    75 
       
    76 static TInt fThread1(TAny*); //High priority thread in this test
       
    77 static TInt fThread2(TAny*); //High priority thread in this test
       
    78 static TInt fThread3(TAny*); //High priority thread in this test
       
    79 
       
    80 	CTest16MemoryFull* iTestObject;
       
    81 	TInt iRequested_size[KFactor];
       
    82 	TDes8 *iDes1;
       
    83 	TDes8 *iDes2;
       
    84 	RThread iThread1;
       
    85 	RThread iThread2;
       
    86 	RThread iThread3;
       
    87 	
       
    88 	TInt iRequestloop;
       
    89 	
       
    90 	RMBufAsyncRequest& iMBufAsyncReq;
       
    91 	RMBufChain iChain;
       
    92 };
       
    93 
       
    94 #endif //(__TEST16MEMORYFULL_H__)