|
1 // Copyright (c) 2004-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\system\d_dobject.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __D_DOBJECT_H__ |
|
19 #define __D_DOBJECT_H__ |
|
20 #include <e32cmn.h> |
|
21 #ifndef __KERNEL_MODE__ |
|
22 #include <e32std.h> |
|
23 #endif |
|
24 |
|
25 |
|
26 struct SParam |
|
27 { |
|
28 TInt duration; |
|
29 TUint iSeed[2]; |
|
30 TBool iPerformanceTest; |
|
31 }; |
|
32 |
|
33 class RTestDObject : public RBusLogicalChannel |
|
34 { |
|
35 public: |
|
36 enum TControl |
|
37 { |
|
38 ERObjectIxTest1, |
|
39 ERObjectIxTest2, |
|
40 ERObjectIxTest3, |
|
41 ERObjectIxTest4, |
|
42 ERObjectIxThreadTestCreateIx, |
|
43 ERObjectIxThreadTestExerciseIx, |
|
44 ERObjectIxThreadTestFreeIx, |
|
45 ERObjectIxInvalidHandleLookupTest, |
|
46 EDObjectNameTest, |
|
47 }; |
|
48 public: |
|
49 inline TInt Open(); |
|
50 |
|
51 public: |
|
52 inline TInt RObjectIxTest1(TInt& aTime); |
|
53 inline TInt RObjectIxTest2(TInt& aTime); |
|
54 inline TInt RObjectIxTest3(SParam& aParam); |
|
55 inline TInt RObjectIxTest4(TInt& aTime); |
|
56 inline TInt RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr); |
|
57 inline TInt RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr); |
|
58 inline TInt RObjectIxThreadTestFreeIx(void* aRObjectIxPtr); |
|
59 inline TInt InvalidHandleLookupTest(); |
|
60 inline TInt DObjectNameTest(); |
|
61 }; |
|
62 |
|
63 _LIT(KDObjectTestLddName,"D_DOBJECT"); |
|
64 |
|
65 |
|
66 #ifndef __KERNEL_MODE__ |
|
67 inline TInt RTestDObject::Open() |
|
68 { return DoCreate(KDObjectTestLddName,TVersion(),KNullUnit,NULL,NULL); } |
|
69 |
|
70 inline TInt RTestDObject::RObjectIxTest1(TInt& aTime) |
|
71 { |
|
72 TRequestStatus aStatus; |
|
73 DoRequest(ERObjectIxTest1,aStatus, &aTime); |
|
74 User::WaitForRequest(aStatus); |
|
75 return aStatus.Int(); |
|
76 } |
|
77 |
|
78 inline TInt RTestDObject::RObjectIxTest2(TInt& aTime) |
|
79 { |
|
80 TRequestStatus aStatus; |
|
81 DoRequest(ERObjectIxTest2,aStatus, &aTime); |
|
82 User::WaitForRequest(aStatus); |
|
83 return aStatus.Int(); |
|
84 } |
|
85 |
|
86 inline TInt RTestDObject::RObjectIxTest3(SParam& aParam) |
|
87 { |
|
88 TRequestStatus aStatus; |
|
89 DoRequest(ERObjectIxTest3,aStatus, &aParam); |
|
90 User::WaitForRequest(aStatus); |
|
91 return aStatus.Int(); |
|
92 } |
|
93 |
|
94 inline TInt RTestDObject::RObjectIxTest4(TInt& aTime) |
|
95 { |
|
96 TRequestStatus aStatus; |
|
97 DoRequest(ERObjectIxTest4,aStatus, &aTime); |
|
98 User::WaitForRequest(aStatus); |
|
99 return aStatus.Int(); |
|
100 } // RTestDObject::RObjectIxTest4 |
|
101 |
|
102 inline TInt RTestDObject::RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr) |
|
103 { |
|
104 TRequestStatus aStatus; |
|
105 DoRequest(ERObjectIxThreadTestCreateIx,aStatus, &aRObjectIxPtr); |
|
106 User::WaitForRequest(aStatus); |
|
107 return aStatus.Int(); |
|
108 } // RTestDObject::RObjectIxThreadTestCreateIx |
|
109 |
|
110 inline TInt RTestDObject::RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr) |
|
111 { |
|
112 TRequestStatus aStatus; |
|
113 DoRequest(ERObjectIxThreadTestExerciseIx, aStatus, aRObjectIxPtr); |
|
114 User::WaitForRequest(aStatus); |
|
115 return aStatus.Int(); |
|
116 } // RTestDObject::RObjectIxThreadTestExerciseIx |
|
117 |
|
118 inline TInt RTestDObject::RObjectIxThreadTestFreeIx(void* aRObjectIxPtr) |
|
119 { |
|
120 TRequestStatus aStatus; |
|
121 DoRequest(ERObjectIxThreadTestFreeIx,aStatus, aRObjectIxPtr); |
|
122 User::WaitForRequest(aStatus); |
|
123 return aStatus.Int(); |
|
124 } // RTestDObject::RObjectIxThreadTestFreeIx |
|
125 |
|
126 inline TInt RTestDObject::InvalidHandleLookupTest() |
|
127 { |
|
128 TRequestStatus aStatus; |
|
129 DoRequest(ERObjectIxInvalidHandleLookupTest, aStatus); |
|
130 User::WaitForRequest(aStatus); |
|
131 return aStatus.Int(); |
|
132 } // RTestDObject::InvalidHandleLookupTest |
|
133 |
|
134 inline TInt RTestDObject::DObjectNameTest(void) |
|
135 { |
|
136 TRequestStatus aStatus; |
|
137 DoRequest(EDObjectNameTest, aStatus); |
|
138 User::WaitForRequest(aStatus); |
|
139 return aStatus.Int(); |
|
140 } |
|
141 #endif |
|
142 |
|
143 #endif |
|
144 |