sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32test\system\d_dobject.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef __D_DOBJECT_H__
|
sl@0
|
19 |
#define __D_DOBJECT_H__
|
sl@0
|
20 |
#include <e32cmn.h>
|
sl@0
|
21 |
#ifndef __KERNEL_MODE__
|
sl@0
|
22 |
#include <e32std.h>
|
sl@0
|
23 |
#endif
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
struct SParam
|
sl@0
|
27 |
{
|
sl@0
|
28 |
TInt duration;
|
sl@0
|
29 |
TUint iSeed[2];
|
sl@0
|
30 |
TBool iPerformanceTest;
|
sl@0
|
31 |
};
|
sl@0
|
32 |
|
sl@0
|
33 |
class RTestDObject : public RBusLogicalChannel
|
sl@0
|
34 |
{
|
sl@0
|
35 |
public:
|
sl@0
|
36 |
enum TControl
|
sl@0
|
37 |
{
|
sl@0
|
38 |
ERObjectIxTest1,
|
sl@0
|
39 |
ERObjectIxTest2,
|
sl@0
|
40 |
ERObjectIxTest3,
|
sl@0
|
41 |
ERObjectIxTest4,
|
sl@0
|
42 |
ERObjectIxThreadTestCreateIx,
|
sl@0
|
43 |
ERObjectIxThreadTestExerciseIx,
|
sl@0
|
44 |
ERObjectIxThreadTestFreeIx,
|
sl@0
|
45 |
ERObjectIxInvalidHandleLookupTest,
|
sl@0
|
46 |
EDObjectNameTest,
|
sl@0
|
47 |
};
|
sl@0
|
48 |
public:
|
sl@0
|
49 |
inline TInt Open();
|
sl@0
|
50 |
|
sl@0
|
51 |
public:
|
sl@0
|
52 |
inline TInt RObjectIxTest1(TInt& aTime);
|
sl@0
|
53 |
inline TInt RObjectIxTest2(TInt& aTime);
|
sl@0
|
54 |
inline TInt RObjectIxTest3(SParam& aParam);
|
sl@0
|
55 |
inline TInt RObjectIxTest4(TInt& aTime);
|
sl@0
|
56 |
inline TInt RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr);
|
sl@0
|
57 |
inline TInt RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr);
|
sl@0
|
58 |
inline TInt RObjectIxThreadTestFreeIx(void* aRObjectIxPtr);
|
sl@0
|
59 |
inline TInt InvalidHandleLookupTest();
|
sl@0
|
60 |
inline TInt DObjectNameTest();
|
sl@0
|
61 |
};
|
sl@0
|
62 |
|
sl@0
|
63 |
_LIT(KDObjectTestLddName,"D_DOBJECT");
|
sl@0
|
64 |
|
sl@0
|
65 |
|
sl@0
|
66 |
#ifndef __KERNEL_MODE__
|
sl@0
|
67 |
inline TInt RTestDObject::Open()
|
sl@0
|
68 |
{ return DoCreate(KDObjectTestLddName,TVersion(),KNullUnit,NULL,NULL); }
|
sl@0
|
69 |
|
sl@0
|
70 |
inline TInt RTestDObject::RObjectIxTest1(TInt& aTime)
|
sl@0
|
71 |
{
|
sl@0
|
72 |
TRequestStatus aStatus;
|
sl@0
|
73 |
DoRequest(ERObjectIxTest1,aStatus, &aTime);
|
sl@0
|
74 |
User::WaitForRequest(aStatus);
|
sl@0
|
75 |
return aStatus.Int();
|
sl@0
|
76 |
}
|
sl@0
|
77 |
|
sl@0
|
78 |
inline TInt RTestDObject::RObjectIxTest2(TInt& aTime)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
TRequestStatus aStatus;
|
sl@0
|
81 |
DoRequest(ERObjectIxTest2,aStatus, &aTime);
|
sl@0
|
82 |
User::WaitForRequest(aStatus);
|
sl@0
|
83 |
return aStatus.Int();
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
inline TInt RTestDObject::RObjectIxTest3(SParam& aParam)
|
sl@0
|
87 |
{
|
sl@0
|
88 |
TRequestStatus aStatus;
|
sl@0
|
89 |
DoRequest(ERObjectIxTest3,aStatus, &aParam);
|
sl@0
|
90 |
User::WaitForRequest(aStatus);
|
sl@0
|
91 |
return aStatus.Int();
|
sl@0
|
92 |
}
|
sl@0
|
93 |
|
sl@0
|
94 |
inline TInt RTestDObject::RObjectIxTest4(TInt& aTime)
|
sl@0
|
95 |
{
|
sl@0
|
96 |
TRequestStatus aStatus;
|
sl@0
|
97 |
DoRequest(ERObjectIxTest4,aStatus, &aTime);
|
sl@0
|
98 |
User::WaitForRequest(aStatus);
|
sl@0
|
99 |
return aStatus.Int();
|
sl@0
|
100 |
} // RTestDObject::RObjectIxTest4
|
sl@0
|
101 |
|
sl@0
|
102 |
inline TInt RTestDObject::RObjectIxThreadTestCreateIx(void*& aRObjectIxPtr)
|
sl@0
|
103 |
{
|
sl@0
|
104 |
TRequestStatus aStatus;
|
sl@0
|
105 |
DoRequest(ERObjectIxThreadTestCreateIx,aStatus, &aRObjectIxPtr);
|
sl@0
|
106 |
User::WaitForRequest(aStatus);
|
sl@0
|
107 |
return aStatus.Int();
|
sl@0
|
108 |
} // RTestDObject::RObjectIxThreadTestCreateIx
|
sl@0
|
109 |
|
sl@0
|
110 |
inline TInt RTestDObject::RObjectIxThreadTestExerciseIx(void* aRObjectIxPtr)
|
sl@0
|
111 |
{
|
sl@0
|
112 |
TRequestStatus aStatus;
|
sl@0
|
113 |
DoRequest(ERObjectIxThreadTestExerciseIx, aStatus, aRObjectIxPtr);
|
sl@0
|
114 |
User::WaitForRequest(aStatus);
|
sl@0
|
115 |
return aStatus.Int();
|
sl@0
|
116 |
} // RTestDObject::RObjectIxThreadTestExerciseIx
|
sl@0
|
117 |
|
sl@0
|
118 |
inline TInt RTestDObject::RObjectIxThreadTestFreeIx(void* aRObjectIxPtr)
|
sl@0
|
119 |
{
|
sl@0
|
120 |
TRequestStatus aStatus;
|
sl@0
|
121 |
DoRequest(ERObjectIxThreadTestFreeIx,aStatus, aRObjectIxPtr);
|
sl@0
|
122 |
User::WaitForRequest(aStatus);
|
sl@0
|
123 |
return aStatus.Int();
|
sl@0
|
124 |
} // RTestDObject::RObjectIxThreadTestFreeIx
|
sl@0
|
125 |
|
sl@0
|
126 |
inline TInt RTestDObject::InvalidHandleLookupTest()
|
sl@0
|
127 |
{
|
sl@0
|
128 |
TRequestStatus aStatus;
|
sl@0
|
129 |
DoRequest(ERObjectIxInvalidHandleLookupTest, aStatus);
|
sl@0
|
130 |
User::WaitForRequest(aStatus);
|
sl@0
|
131 |
return aStatus.Int();
|
sl@0
|
132 |
} // RTestDObject::InvalidHandleLookupTest
|
sl@0
|
133 |
|
sl@0
|
134 |
inline TInt RTestDObject::DObjectNameTest(void)
|
sl@0
|
135 |
{
|
sl@0
|
136 |
TRequestStatus aStatus;
|
sl@0
|
137 |
DoRequest(EDObjectNameTest, aStatus);
|
sl@0
|
138 |
User::WaitForRequest(aStatus);
|
sl@0
|
139 |
return aStatus.Int();
|
sl@0
|
140 |
}
|
sl@0
|
141 |
#endif
|
sl@0
|
142 |
|
sl@0
|
143 |
#endif
|
sl@0
|
144 |
|