1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/nkern/d_crazyints.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,101 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32test\nkern\d_crazyints.h
1.18 +//
1.19 +
1.20 +#ifndef __CRAZYINTS_H__
1.21 +#define __CRAZYINTS_H__
1.22 +
1.23 +#include <e32cmn.h>
1.24 +#include <e32ver.h>
1.25 +
1.26 +const TInt KIntTestThreadPriority = 24;
1.27 +
1.28 +const TInt KIntTestMajorVersionNumber = 1;
1.29 +const TInt KIntTestMinorVersionNumber = 0;
1.30 +const TInt KIntTestBuildVersionNumber = KE32BuildVersionNumber;
1.31 +
1.32 +const TInt KNumOfTimes = 100; // number of times we kick off the time
1.33 +const TInt KTimerWaitValue = 3; //number of timer ticks we use to set the timer..
1.34 +
1.35 +class RBusIntTestClient: public RBusLogicalChannel
1.36 + {
1.37 +public:
1.38 + enum TControl
1.39 + {
1.40 + ETestCrazyInts
1.41 + };
1.42 +
1.43 +#ifndef __KERNEL_MODE__
1.44 +public:
1.45 + TInt Open(TDesC& aProxyName)
1.46 + {return (DoCreate(aProxyName,TVersion(KIntTestMajorVersionNumber,KIntTestMinorVersionNumber,KIntTestBuildVersionNumber),-1,NULL,NULL,EOwnerThread));}
1.47 +
1.48 + // test-cases
1.49 + TInt TestCrazyInts()
1.50 + {return DoControl(ETestCrazyInts, NULL);}
1.51 +
1.52 +
1.53 +#endif
1.54 + };
1.55 +
1.56 +#ifdef __KERNEL_MODE__
1.57 +struct TCapsProxyClient
1.58 + {
1.59 + TVersion version;
1.60 + };
1.61 +
1.62 +class DDeviceIntsTest: public DLogicalDevice
1.63 + {
1.64 +public:
1.65 + DDeviceIntsTest();
1.66 + ~DDeviceIntsTest();
1.67 + virtual TInt Install();
1.68 + virtual void GetCaps(TDes8 &aDes) const;
1.69 + virtual TInt Create(DLogicalChannelBase*& aChannel);
1.70 + };
1.71 +
1.72 +// declaration for the client channel
1.73 +class DChannIntsTest: public DLogicalChannel
1.74 + {
1.75 +public:
1.76 + DChannIntsTest();
1.77 + ~DChannIntsTest();
1.78 + virtual TInt DoCreate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
1.79 + static void Handler(TAny *aParam);
1.80 +
1.81 +
1.82 +protected:
1.83 + virtual void HandleMsg(TMessageBase* aMsg); // Note: this is a pure virtual in DLogicalChannel
1.84 +
1.85 + TInt DoControl(TInt aId, TAny* a1, TAny* a2);
1.86 + TInt DoRequest(TInt aId, TRequestStatus* aStatus, TAny* a1, TAny* a2);
1.87 +
1.88 +private:
1.89 +#ifdef __SMP__
1.90 + TInt TestCrazyInts();
1.91 + TBool CrazyInterruptsEnabled();
1.92 +
1.93 + TUint iStatus;
1.94 + NTimer iTimer;
1.95 + TInt iRunCount;
1.96 +#endif
1.97 + TDynamicDfcQue* iDfcQue; // Kernel thread for the test driver
1.98 + DThread* iClient;
1.99 + };
1.100 +
1.101 +
1.102 +#endif /* __KERNEL_MODE__ */
1.103 +
1.104 +#endif /* __CRAZYINTS_H__ */