First public contribution.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // DEF075471 buffer security test
21 @internalComponent - Internal Symbian test code
24 #ifndef __TBUFFERSECURITY_H__
25 #define __TBUFFERSECURITY_H__
28 #include "../tlib/testbase.h"
30 #include "../SERVER/w32cmd.h"
32 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
33 #include "../nonnga/CLIENT/w32comm.h"
36 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
37 #include "../nga/CLIENT/w32comm.h"
40 #include <e32property.h>
41 #include "TGraphicsHarness.h"
43 //Set this #define to add extra logging to this test case (useful when debugging a test fail)
44 //#define _TBUFS_LOGGING
46 //Set this #define to initiate a long running soak test, this should be done periodically
47 //#define _TBUFS_TEST_SOAK_TEST
50 #define TBufSStartLogText StartLogText
51 #define TBufSLogText LogText
52 #define TBufSLogFormat LogFormat
54 #define TBufSStartLogText
56 #define TBufSLogFormat
59 LOCAL_D const TUint KPanicThreadHeapSize=0x4000;
61 _LIT(KLitKernExec, "KERN-EXEC");
62 _LIT(KTestName, "DEF086238 Buffer Security Test");
63 static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
64 static _LIT_SECURITY_POLICY_C1(KWriteDeviceDataMgmtPolicy,ECapabilityWriteDeviceData);
65 const TInt KTestDataMax = 256;
66 const TInt KTestDataMax32 = KTestDataMax/4;
68 struct TTestThreadData
73 TUint8 iData[KTestDataMax];
74 TUint32 iData32[KTestDataMax32];
89 TWsClCmdSetPointerCursorArea* cursorArea;
90 TWsClCmdHeapSetFail *heapSetFail;
91 TXYInputType *xyInputType;
94 class CTBufferSecurity : public CTWsGraphicsBase
97 CTBufferSecurity(CTestStep* aStep);
99 void TestWsBufferL(TInt aOpCode, TUint aDataFill, TBool aEightBit=ETrue);
100 void TestBadStringAnimDllL();
101 void TestBadStringL();
105 //from CTGraphicsStep
106 virtual void RunTestCaseL(TInt aCurTestCase);
108 void TestBufferSecurityL();
111 class RTestIpcSession : public RSessionBase
114 inline RTestIpcSession() {};
116 TInt SendBadBuffer();
121 class CTBufferSecurityStep : public CTGraphicsStep
124 CTBufferSecurityStep();
126 //from CTGraphicsStep
127 virtual CTGraphicsBase* CreateTestL();
130 _LIT(KTBufferSecurityStep,"TBufferSecurity");