sl@0
|
1 |
// Copyright (c) 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 "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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@test
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
#ifndef EGLTEST_SYNCOBJECT_H
|
sl@0
|
21 |
#define EGLTEST_SYNCOBJECT_H
|
sl@0
|
22 |
|
sl@0
|
23 |
#include "eglteststep.h"
|
sl@0
|
24 |
#include <test/egltestcommonsession.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
|
sl@0
|
27 |
_LIT(KSyncObject_Positive_Base, "SyncObject_Base");
|
sl@0
|
28 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Base) : public CEglTestStep
|
sl@0
|
29 |
{
|
sl@0
|
30 |
public:
|
sl@0
|
31 |
CEglTest_SyncObject_Base();
|
sl@0
|
32 |
~CEglTest_SyncObject_Base();
|
sl@0
|
33 |
TBool GetProcAddress();
|
sl@0
|
34 |
void CreateEglSessionL();
|
sl@0
|
35 |
void CheckSyncAttrib(EGLint attribute, EGLint expectedValue);
|
sl@0
|
36 |
void CleanAll();
|
sl@0
|
37 |
|
sl@0
|
38 |
/**
|
sl@0
|
39 |
@param aEndTime End time obtained from the user nano kernel tick counter
|
sl@0
|
40 |
@param aStartTime Start time obtained from the user nano kernel tick counter
|
sl@0
|
41 |
@return elapsed time in microsecond
|
sl@0
|
42 |
*/
|
sl@0
|
43 |
inline TInt ElapsedTime(TUint32 aEndTime, TUint32 aStartTime) const
|
sl@0
|
44 |
{
|
sl@0
|
45 |
return ((aEndTime - aStartTime) * iTickPeriodMicroSeconds);
|
sl@0
|
46 |
}
|
sl@0
|
47 |
|
sl@0
|
48 |
// from CTestStep
|
sl@0
|
49 |
TVerdict doTestStepPreambleL();
|
sl@0
|
50 |
|
sl@0
|
51 |
protected:
|
sl@0
|
52 |
CTestEglSession* iEglSess;
|
sl@0
|
53 |
EGLSyncKHR iSyncObject;
|
sl@0
|
54 |
EGLSyncKHR iSyncObject1;
|
sl@0
|
55 |
EGLSyncKHR iSyncObject2;
|
sl@0
|
56 |
|
sl@0
|
57 |
TBool iIsSyncObjectExtensionSupported; //sync object API, defined in EGL Khronos API spec with the name KHR_reusable_sync
|
sl@0
|
58 |
TBool iIsSyncObjectPrivateExtensionSupported; //internal NOKIA extension which is not the part of the Khronos API spec
|
sl@0
|
59 |
|
sl@0
|
60 |
TInt iThreshold; //level of tolerance
|
sl@0
|
61 |
TInt iDelaySignalling; //delay before the signal occurs
|
sl@0
|
62 |
TInt iWaitSyncTimeout; //timeout client waits on sync object, must be greater than iDelaySignalling
|
sl@0
|
63 |
TInt iLongDelaySignalling; //long delay before signalling occurs, must be greater than iWaitSyncTimeout
|
sl@0
|
64 |
TInt iNumStressIterations; //number of iterations before stress test exits
|
sl@0
|
65 |
TInt iTimeOverhead;
|
sl@0
|
66 |
|
sl@0
|
67 |
TFPtrEglCreateSyncKhr iPfnEglCreateSyncKHR;
|
sl@0
|
68 |
TFPtrEglDestroySyncKhr iPfnEglDestroySyncKHR;
|
sl@0
|
69 |
TFPtrEglClientWaitSyncKhr iPfnEglClientWaitSyncKHR;
|
sl@0
|
70 |
TFPtrEglSignalSyncKhr iPfnEglSignalSyncKHR;
|
sl@0
|
71 |
TFPtrEglGetSyncAttribKhr iPfnEglGetSyncAttribKHR;
|
sl@0
|
72 |
TFPtrEglPrivateSignalSyncNok iPfnEglPrivateSignalSyncNOK;
|
sl@0
|
73 |
|
sl@0
|
74 |
TInt iTickPeriodMicroSeconds; //nanokernel ticks, in microseconds
|
sl@0
|
75 |
};
|
sl@0
|
76 |
|
sl@0
|
77 |
_LIT(KSyncObject_Positive_GetProcAddress, "SyncObject_Positive_GetProcAddress");
|
sl@0
|
78 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_GetProcAddress) : public CEglTest_SyncObject_Base
|
sl@0
|
79 |
{
|
sl@0
|
80 |
public:
|
sl@0
|
81 |
TVerdict doTestStepL();
|
sl@0
|
82 |
};
|
sl@0
|
83 |
|
sl@0
|
84 |
_LIT(KSyncObject_Positive_CreateDestroy, "SyncObject_Positive_CreateDestroy");
|
sl@0
|
85 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_CreateDestroy) : public CEglTest_SyncObject_Base
|
sl@0
|
86 |
{
|
sl@0
|
87 |
public:
|
sl@0
|
88 |
TVerdict doTestStepL();
|
sl@0
|
89 |
};
|
sl@0
|
90 |
|
sl@0
|
91 |
_LIT(KSyncObject_Positive_WaitSignal, "SyncObject_Positive_WaitSignal");
|
sl@0
|
92 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_WaitSignal) : public CEglTest_SyncObject_Base
|
sl@0
|
93 |
{
|
sl@0
|
94 |
public:
|
sl@0
|
95 |
TVerdict doTestStepL();
|
sl@0
|
96 |
protected:
|
sl@0
|
97 |
// from CEglTestStep
|
sl@0
|
98 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
99 |
};
|
sl@0
|
100 |
|
sl@0
|
101 |
_LIT(KSyncObject_Positive_WaitSignal2, "SyncObject_Positive_WaitSignal2");
|
sl@0
|
102 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_WaitSignal2) : public CEglTest_SyncObject_Base
|
sl@0
|
103 |
{
|
sl@0
|
104 |
public:
|
sl@0
|
105 |
TVerdict doTestStepL();
|
sl@0
|
106 |
protected:
|
sl@0
|
107 |
// from CEglTestStep
|
sl@0
|
108 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
109 |
};
|
sl@0
|
110 |
|
sl@0
|
111 |
_LIT(KSyncObject_Positive_WaitDelete, "SyncObject_Positive_WaitDelete");
|
sl@0
|
112 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_WaitDelete) : public CEglTest_SyncObject_Base
|
sl@0
|
113 |
{
|
sl@0
|
114 |
public:
|
sl@0
|
115 |
TVerdict doTestStepL();
|
sl@0
|
116 |
protected:
|
sl@0
|
117 |
// from CEglTestStep
|
sl@0
|
118 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
119 |
};
|
sl@0
|
120 |
|
sl@0
|
121 |
_LIT(KSyncObject_Positive_WaitWithTimeoutExpired, "SyncObject_Positive_WaitWithTimeoutExpired");
|
sl@0
|
122 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_WaitWithTimeoutExpired) : public CEglTest_SyncObject_Base
|
sl@0
|
123 |
{
|
sl@0
|
124 |
public:
|
sl@0
|
125 |
TVerdict doTestStepL();
|
sl@0
|
126 |
};
|
sl@0
|
127 |
|
sl@0
|
128 |
_LIT(KSyncObject_Positive_SignalBeforeTimeoutExpired, "SyncObject_Positive_SignalBeforeTimeoutExpired");
|
sl@0
|
129 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_SignalBeforeTimeoutExpired) : public CEglTest_SyncObject_Base
|
sl@0
|
130 |
{
|
sl@0
|
131 |
public:
|
sl@0
|
132 |
TVerdict doTestStepL();
|
sl@0
|
133 |
protected:
|
sl@0
|
134 |
// from CEglTestStep
|
sl@0
|
135 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
136 |
};
|
sl@0
|
137 |
|
sl@0
|
138 |
_LIT(KSyncObject_Positive_DeleteBeforeTimeoutExpired, "SyncObject_Positive_DeleteBeforeTimeoutExpired");
|
sl@0
|
139 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_DeleteBeforeTimeoutExpired) : public CEglTest_SyncObject_Base
|
sl@0
|
140 |
{
|
sl@0
|
141 |
public:
|
sl@0
|
142 |
TVerdict doTestStepL();
|
sl@0
|
143 |
protected:
|
sl@0
|
144 |
// from CEglTestStep
|
sl@0
|
145 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
146 |
};
|
sl@0
|
147 |
|
sl@0
|
148 |
_LIT(KSyncObject_Positive_Multithread_SignalBeforeTimeout, "SyncObject_Positive_Multithread_SignalBeforeTimeout");
|
sl@0
|
149 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Multithread_SignalBeforeTimeout) : public CEglTest_SyncObject_Base
|
sl@0
|
150 |
{
|
sl@0
|
151 |
public:
|
sl@0
|
152 |
TVerdict doTestStepL();
|
sl@0
|
153 |
protected:
|
sl@0
|
154 |
// from CEglTestStep
|
sl@0
|
155 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
156 |
};
|
sl@0
|
157 |
|
sl@0
|
158 |
_LIT(KSyncObject_Positive_Multithread_SignalAfterTimeout, "SyncObject_Positive_Multithread_SignalAfterTimeout");
|
sl@0
|
159 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Multithread_SignalAfterTimeout) : public CEglTest_SyncObject_Base
|
sl@0
|
160 |
{
|
sl@0
|
161 |
public:
|
sl@0
|
162 |
TVerdict doTestStepL();
|
sl@0
|
163 |
protected:
|
sl@0
|
164 |
// from CEglTestStep
|
sl@0
|
165 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
166 |
};
|
sl@0
|
167 |
|
sl@0
|
168 |
_LIT(KSyncObject_Positive_Multithread_WaitOnTwoSyncObject, "SyncObject_Positive_Multithread_WaitOnTwoSyncObject");
|
sl@0
|
169 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Multithread_WaitOnTwoSyncObject) : public CEglTest_SyncObject_Base
|
sl@0
|
170 |
{
|
sl@0
|
171 |
public:
|
sl@0
|
172 |
TVerdict doTestStepL();
|
sl@0
|
173 |
protected:
|
sl@0
|
174 |
// from CEglTestStep
|
sl@0
|
175 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
176 |
};
|
sl@0
|
177 |
|
sl@0
|
178 |
_LIT(KSyncObject_Positive_Wait_TestMode, "SyncObject_Positive_Wait_TestMode");
|
sl@0
|
179 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Wait_TestMode) : public CEglTest_SyncObject_Base
|
sl@0
|
180 |
{
|
sl@0
|
181 |
public:
|
sl@0
|
182 |
TVerdict doTestStepL();
|
sl@0
|
183 |
};
|
sl@0
|
184 |
|
sl@0
|
185 |
_LIT(KSyncObject_Positive_Multithread_Deletion, "SyncObject_Positive_Multithread_Deletion");
|
sl@0
|
186 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Multithread_Deletion) : public CEglTest_SyncObject_Base
|
sl@0
|
187 |
{
|
sl@0
|
188 |
public:
|
sl@0
|
189 |
TVerdict doTestStepL();
|
sl@0
|
190 |
protected:
|
sl@0
|
191 |
// from CEglTestStep
|
sl@0
|
192 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
193 |
};
|
sl@0
|
194 |
|
sl@0
|
195 |
_LIT(KSyncObject_Positive_Stress, "SyncObject_Positive_Stress");
|
sl@0
|
196 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Stress) : public CEglTest_SyncObject_Base
|
sl@0
|
197 |
{
|
sl@0
|
198 |
public:
|
sl@0
|
199 |
TVerdict doTestStepL();
|
sl@0
|
200 |
protected:
|
sl@0
|
201 |
// from CEglTestStep
|
sl@0
|
202 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
203 |
private:
|
sl@0
|
204 |
TBool iStopTest; //to ensure that we are not going to signal on deleted sync objects
|
sl@0
|
205 |
TInt iLastThreadToSignal; //varies from 0..2, where 2 is the main client thread
|
sl@0
|
206 |
};
|
sl@0
|
207 |
|
sl@0
|
208 |
_LIT(KSyncObject_Positive_WaitFlush, "SyncObject_Positive_WaitFlush");
|
sl@0
|
209 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_WaitFlush) : public CEglTest_SyncObject_Base
|
sl@0
|
210 |
{
|
sl@0
|
211 |
public:
|
sl@0
|
212 |
TVerdict doTestStepL();
|
sl@0
|
213 |
protected:
|
sl@0
|
214 |
// from CEglTestStep
|
sl@0
|
215 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
216 |
};
|
sl@0
|
217 |
|
sl@0
|
218 |
_LIT(KSyncObject_Positive_Terminate, "SyncObject_Positive_Terminate");
|
sl@0
|
219 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_Terminate) : public CEglTest_SyncObject_Base
|
sl@0
|
220 |
{
|
sl@0
|
221 |
public:
|
sl@0
|
222 |
TVerdict doTestStepL();
|
sl@0
|
223 |
};
|
sl@0
|
224 |
|
sl@0
|
225 |
_LIT(KSyncObject_Positive_TerminateBeforeTimeoutExpired, "SyncObject_Positive_TerminateBeforeTimeoutExpired");
|
sl@0
|
226 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Positive_TerminateBeforeTimeoutExpired) : public CEglTest_SyncObject_Base
|
sl@0
|
227 |
{
|
sl@0
|
228 |
public:
|
sl@0
|
229 |
TVerdict doTestStepL();
|
sl@0
|
230 |
protected:
|
sl@0
|
231 |
// from CEglTestStep
|
sl@0
|
232 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
233 |
};
|
sl@0
|
234 |
|
sl@0
|
235 |
_LIT(KSyncObject_Negative_WrongParameters, "SyncObject_Negative_WrongParameters");
|
sl@0
|
236 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Negative_WrongParameters) : public CEglTest_SyncObject_Base
|
sl@0
|
237 |
{
|
sl@0
|
238 |
public:
|
sl@0
|
239 |
TVerdict doTestStepL();
|
sl@0
|
240 |
};
|
sl@0
|
241 |
|
sl@0
|
242 |
_LIT(KSyncObject_Negative_SignalImpl, "SyncObject_Negative_SignalImpl");
|
sl@0
|
243 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Negative_SignalImpl) : public CEglTest_SyncObject_Base
|
sl@0
|
244 |
{
|
sl@0
|
245 |
public:
|
sl@0
|
246 |
TVerdict doTestStepL();
|
sl@0
|
247 |
};
|
sl@0
|
248 |
|
sl@0
|
249 |
_LIT(KSyncObject_Negative_OOM, "SyncObject_Negative_OOM");
|
sl@0
|
250 |
NONSHARABLE_CLASS(CEglTest_SyncObject_Negative_OOM) : public CEglTest_SyncObject_Base
|
sl@0
|
251 |
{
|
sl@0
|
252 |
public:
|
sl@0
|
253 |
TVerdict doTestStepL();
|
sl@0
|
254 |
protected:
|
sl@0
|
255 |
// from CEglTestStep
|
sl@0
|
256 |
void doThreadFunctionL(TInt aIdx);
|
sl@0
|
257 |
};
|
sl@0
|
258 |
|
sl@0
|
259 |
#endif // EGLTEST_SYNCOBJECT_H
|