1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/system/d_dobject.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,144 @@
1.4 +// Copyright (c) 2004-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\system\d_dobject.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __D_DOBJECT_H__
1.22 +#define __D_DOBJECT_H__
1.23 +#include <e32cmn.h>
1.24 +#ifndef __KERNEL_MODE__
1.25 +#include <e32std.h>
1.26 +#endif
1.27 +
1.28 +
1.29 +struct SParam
1.30 + {
1.31 + TInt duration;
1.32 + TUint iSeed[2];
1.33 + TBool iPerformanceTest;
1.34 + };
1.35 +
1.36 +class RTestDObject : public RBusLogicalChannel
1.37 + {
1.38 +public:
1.39 + enum TControl
1.40 + {
1.41 + ERObjectIxTest1,
1.42 + ERObjectIxTest2,
1.43 + ERObjectIxTest3,
1.44 + ERObjectIxTest4,
1.45 + ERObjectIxThreadTestCreateIx,
1.46 + ERObjectIxThreadTestExerciseIx,
1.47 + ERObjectIxThreadTestFreeIx,
1.48 + ERObjectIxInvalidHandleLookupTest,
1.49 + EDObjectNameTest,
1.50 + };
1.51 +public:
1.52 + inline TInt Open();
1.53 +
1.54 +public:
1.55 + inline TInt RObjectIxTest1(TInt& aTime);
1.56 + inline TInt RObjectIxTest2(TInt& aTime);
1.57 + inline TInt RObjectIxTest3(SParam& aParam);
1.58 + inline TInt RObjectIxTest4(TInt& aTime);
1.59 + inline TInt RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr);
1.60 + inline TInt RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr);
1.61 + inline TInt RObjectIxThreadTestFreeIx(void* aRObjectIxPtr);
1.62 + inline TInt InvalidHandleLookupTest();
1.63 + inline TInt DObjectNameTest();
1.64 + };
1.65 +
1.66 +_LIT(KDObjectTestLddName,"D_DOBJECT");
1.67 +
1.68 +
1.69 +#ifndef __KERNEL_MODE__
1.70 +inline TInt RTestDObject::Open()
1.71 + { return DoCreate(KDObjectTestLddName,TVersion(),KNullUnit,NULL,NULL); }
1.72 +
1.73 +inline TInt RTestDObject::RObjectIxTest1(TInt& aTime)
1.74 + {
1.75 + TRequestStatus aStatus;
1.76 + DoRequest(ERObjectIxTest1,aStatus, &aTime);
1.77 + User::WaitForRequest(aStatus);
1.78 + return aStatus.Int();
1.79 + }
1.80 +
1.81 +inline TInt RTestDObject::RObjectIxTest2(TInt& aTime)
1.82 + {
1.83 + TRequestStatus aStatus;
1.84 + DoRequest(ERObjectIxTest2,aStatus, &aTime);
1.85 + User::WaitForRequest(aStatus);
1.86 + return aStatus.Int();
1.87 + }
1.88 +
1.89 +inline TInt RTestDObject::RObjectIxTest3(SParam& aParam)
1.90 + {
1.91 + TRequestStatus aStatus;
1.92 + DoRequest(ERObjectIxTest3,aStatus, &aParam);
1.93 + User::WaitForRequest(aStatus);
1.94 + return aStatus.Int();
1.95 + }
1.96 +
1.97 +inline TInt RTestDObject::RObjectIxTest4(TInt& aTime)
1.98 + {
1.99 + TRequestStatus aStatus;
1.100 + DoRequest(ERObjectIxTest4,aStatus, &aTime);
1.101 + User::WaitForRequest(aStatus);
1.102 + return aStatus.Int();
1.103 + } // RTestDObject::RObjectIxTest4
1.104 +
1.105 +inline TInt RTestDObject::RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr)
1.106 + {
1.107 + TRequestStatus aStatus;
1.108 + DoRequest(ERObjectIxThreadTestCreateIx,aStatus, &aRObjectIxPtr);
1.109 + User::WaitForRequest(aStatus);
1.110 + return aStatus.Int();
1.111 + } // RTestDObject::RObjectIxThreadTestCreateIx
1.112 +
1.113 +inline TInt RTestDObject::RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr)
1.114 + {
1.115 + TRequestStatus aStatus;
1.116 + DoRequest(ERObjectIxThreadTestExerciseIx, aStatus, aRObjectIxPtr);
1.117 + User::WaitForRequest(aStatus);
1.118 + return aStatus.Int();
1.119 + } // RTestDObject::RObjectIxThreadTestExerciseIx
1.120 +
1.121 +inline TInt RTestDObject::RObjectIxThreadTestFreeIx(void* aRObjectIxPtr)
1.122 + {
1.123 + TRequestStatus aStatus;
1.124 + DoRequest(ERObjectIxThreadTestFreeIx,aStatus, aRObjectIxPtr);
1.125 + User::WaitForRequest(aStatus);
1.126 + return aStatus.Int();
1.127 + } // RTestDObject::RObjectIxThreadTestFreeIx
1.128 +
1.129 +inline TInt RTestDObject::InvalidHandleLookupTest()
1.130 + {
1.131 + TRequestStatus aStatus;
1.132 + DoRequest(ERObjectIxInvalidHandleLookupTest, aStatus);
1.133 + User::WaitForRequest(aStatus);
1.134 + return aStatus.Int();
1.135 + } // RTestDObject::InvalidHandleLookupTest
1.136 +
1.137 +inline TInt RTestDObject::DObjectNameTest(void)
1.138 + {
1.139 + TRequestStatus aStatus;
1.140 + DoRequest(EDObjectNameTest, aStatus);
1.141 + User::WaitForRequest(aStatus);
1.142 + return aStatus.Int();
1.143 + }
1.144 +#endif
1.145 +
1.146 +#endif
1.147 +