os/kernelhwsrv/kerneltest/e32test/nkern/d_crazyints.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 the License "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 // e32test\nkern\d_crazyints.h
    15 //
    16 
    17 #ifndef __CRAZYINTS_H__
    18 #define __CRAZYINTS_H__
    19 
    20 #include <e32cmn.h>
    21 #include <e32ver.h>
    22 
    23 const TInt KIntTestThreadPriority = 24;
    24 
    25 const TInt KIntTestMajorVersionNumber = 1;
    26 const TInt KIntTestMinorVersionNumber = 0;
    27 const TInt KIntTestBuildVersionNumber = KE32BuildVersionNumber;
    28 
    29 const TInt KNumOfTimes = 100; // number of times we kick off the time
    30 const TInt KTimerWaitValue = 3; //number of timer ticks we use to set the timer..
    31 
    32 class RBusIntTestClient: public RBusLogicalChannel
    33 	{
    34 public:
    35 	enum TControl
    36 		{
    37 		ETestCrazyInts
    38 		};
    39 
    40 #ifndef __KERNEL_MODE__
    41 public:
    42 	TInt Open(TDesC& aProxyName)
    43 		{return (DoCreate(aProxyName,TVersion(KIntTestMajorVersionNumber,KIntTestMinorVersionNumber,KIntTestBuildVersionNumber),-1,NULL,NULL,EOwnerThread));}
    44 
    45 	// test-cases
    46 	TInt TestCrazyInts()
    47 		{return DoControl(ETestCrazyInts, NULL);}
    48 
    49 
    50 #endif
    51 	};
    52 
    53 #ifdef __KERNEL_MODE__
    54 struct TCapsProxyClient
    55 	{
    56 	TVersion version;
    57 	};
    58 
    59 class DDeviceIntsTest: public DLogicalDevice
    60 	{
    61 public:
    62 	DDeviceIntsTest();
    63 	~DDeviceIntsTest();
    64 	virtual TInt Install();
    65 	virtual void GetCaps(TDes8 &aDes) const;
    66 	virtual TInt Create(DLogicalChannelBase*& aChannel);
    67 	};
    68 
    69 // declaration for the client channel
    70 class DChannIntsTest: public DLogicalChannel
    71 	{
    72 public:
    73 	DChannIntsTest();
    74 	~DChannIntsTest();
    75 	virtual TInt DoCreate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
    76 	static void Handler(TAny *aParam);
    77 
    78 
    79 protected:
    80 	virtual void HandleMsg(TMessageBase* aMsg); // Note: this is a pure virtual in DLogicalChannel
    81 
    82 	TInt DoControl(TInt aId, TAny* a1, TAny* a2);
    83 	TInt DoRequest(TInt aId, TRequestStatus* aStatus, TAny* a1, TAny* a2);
    84 
    85 private:
    86 #ifdef __SMP__
    87 	TInt TestCrazyInts();
    88 	TBool CrazyInterruptsEnabled();
    89 
    90 	TUint iStatus;
    91 	NTimer iTimer;
    92 	TInt iRunCount;
    93 #endif
    94 	TDynamicDfcQue* iDfcQue; // Kernel thread for the test driver
    95 	DThread* iClient;
    96 	};
    97 
    98 
    99 #endif /* __KERNEL_MODE__ */
   100 
   101 #endif /* __CRAZYINTS_H__ */