os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointstreaming_local.cpp
First public contribution.
1 // Copyright (c) 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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @internalComponent - Internal Symbian test code
20 #include "egltest_endpointstreaming.h"
24 @SYMTestCaseID GRAPHICS-EGL-04xx
33 Test the behaviour of eglEndpointBeginStreamingNOK and eglEndpointEndStreamingNOK with and
34 without bad parameters.
37 Create a number of surfaces
38 For each test case in a loop
39 * start the test in the remote windows server side to create endpoints
40 * in the client side call a surface update on any surface which should have the ready
42 * Send commands with parameters to the windows server process test render stage to
43 begin/end streaming on an end point. These parameters include any error codes which
46 If the procedure was successful release all the resources and check the heap for memory leaks.
47 No memory or handle leaks.
49 @SYMTestExpectedResults
50 If the function fails, the return value is undefined and an error is generated.
51 If dpy is not the handle of a valid EGLDisplay object, the error EGL_BAD_DISPLAY is
52 generated for both BeginSreaming and EndStraming
53 If endpoint is not a valid EGLEndpointNOK object, the error EGL_BAD_ENDPOINT_NOK is
54 generated for both BeginStreaming and EndStraming.
55 If the endpoint is not ready,EGL_BAD_ACCESS is generated for calling BeginStreaming.
59 static const TTestCase KStreamingPositiveCases[] =
62 TESTIDS("545A, 546A"),
63 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin and Endstreaming only"),
64 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
66 { EInitializeCase, 0, EGL_SUCCESS },
67 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
68 { ECreateEndpointCase, 0, EGL_SUCCESS },
69 { EDrawContentCase, 0, EGL_SUCCESS },
70 { EContentUpdateCase, 0, EGL_SUCCESS },
71 { EBeginStreamingCase, 0, EGL_SUCCESS },
72 { EEndStreamingCase, 0, EGL_SUCCESS },
73 { EDestroyEndpointCase, 0, EGL_SUCCESS },
74 { ETerminateCase, 0, EGL_SUCCESS },
79 TESTIDS("545B, 546B"),
80 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin, twice, then Endstreaming"),
81 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
83 { EInitializeCase, 0, EGL_SUCCESS },
84 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
85 { ECreateEndpointCase, 0, EGL_SUCCESS },
86 { EDrawContentCase, 0, EGL_SUCCESS },
87 { EContentUpdateCase, 0, EGL_SUCCESS },
88 { EBeginStreamingCase, 0, EGL_SUCCESS },
89 { EBeginStreamingCase, 0, EGL_SUCCESS },
90 { EEndStreamingCase, 0, EGL_SUCCESS },
91 { EDestroyEndpointCase, 0, EGL_SUCCESS },
92 { ETerminateCase, 0, EGL_SUCCESS },
97 TESTIDS("545C, 546C"),
98 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin then Endstreaming twice"),
99 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
101 { EInitializeCase, 0, EGL_SUCCESS },
102 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
103 { ECreateEndpointCase, 0, EGL_SUCCESS },
104 { EDrawContentCase, 0, EGL_SUCCESS },
105 { EContentUpdateCase, 0, EGL_SUCCESS },
106 { EBeginStreamingCase, 0, EGL_SUCCESS },
107 { EEndStreamingCase, 0, EGL_SUCCESS },
108 { EEndStreamingCase, 0, EGL_SUCCESS },
109 { EDestroyEndpointCase, 0, EGL_SUCCESS },
110 { ETerminateCase, 0, EGL_SUCCESS },
114 // Now check that we can and can't acquire images when in or out of a streaming block.
116 TESTIDS("545D, 546D"),
117 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, acquire, endstreaming"),
118 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
120 { EInitializeCase, 0, EGL_SUCCESS },
121 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
122 { ECreateEndpointCase, 0, EGL_SUCCESS },
123 { EDrawContentCase, 0, EGL_SUCCESS },
124 { EContentUpdateCase, 0, EGL_SUCCESS },
125 { EBeginStreamingCase, 0, EGL_SUCCESS },
126 { EAcquireImageCase, 0, EGL_SUCCESS },
127 { ECompareImageCase, 0, EGL_SUCCESS },
128 { EEndStreamingCase, 0, EGL_SUCCESS },
129 { EDestroyEndpointCase, 0, EGL_SUCCESS },
130 { ETerminateCase, 0, EGL_SUCCESS },
135 TESTIDS("545E, 546E"),
136 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming, acquire"),
137 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
139 { EInitializeCase, 0, EGL_SUCCESS },
140 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
141 { ECreateEndpointCase, 0, EGL_SUCCESS },
142 { EDrawContentCase, 0, EGL_SUCCESS },
143 { EContentUpdateCase, 0, EGL_SUCCESS },
144 { EBeginStreamingCase, 0, EGL_SUCCESS },
145 { EEndStreamingCase, 0, EGL_SUCCESS },
146 { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS },
147 { EDestroyEndpointCase, 0, EGL_SUCCESS },
148 { ETerminateCase, 0, EGL_SUCCESS },
153 TESTIDS("545F, 546F"),
154 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming twice, endstreaming, acquire"),
155 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
157 { EInitializeCase, 0, EGL_SUCCESS },
158 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
159 { ECreateEndpointCase, 0, EGL_SUCCESS },
160 { EDrawContentCase, 0, EGL_SUCCESS },
161 { EContentUpdateCase, 0, EGL_SUCCESS },
162 { EBeginStreamingCase, 0, EGL_SUCCESS },
163 { EBeginStreamingCase, 0, EGL_SUCCESS },
164 { EEndStreamingCase, 0, EGL_SUCCESS },
165 { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS },
166 { EDestroyEndpointCase, 0, EGL_SUCCESS },
167 { ETerminateCase, 0, EGL_SUCCESS },
172 TESTIDS("545G, 546G"),
173 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming twice, beginstreaming, acquire"),
174 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
176 { EInitializeCase, 0, EGL_SUCCESS },
177 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
178 { ECreateEndpointCase, 0, EGL_SUCCESS },
179 { EDrawContentCase, 0, EGL_SUCCESS },
180 { EContentUpdateCase, 0, EGL_SUCCESS },
181 { EBeginStreamingCase, 0, EGL_SUCCESS },
182 { EEndStreamingCase, 0, EGL_SUCCESS },
183 { EEndStreamingCase, 0, EGL_SUCCESS },
184 { EDrawContentCase, 0, EGL_SUCCESS },
185 { EContentUpdateCase, 0, EGL_SUCCESS },
186 { EBeginStreamingCase, 0, EGL_SUCCESS },
187 { EAcquireImageCase, 0, EGL_SUCCESS },
188 { ECompareImageCase, 0, EGL_SUCCESS },
189 { EEndStreamingCase, 0, EGL_SUCCESS },
190 { EDestroyEndpointCase, 0, EGL_SUCCESS },
191 { ETerminateCase, 0, EGL_SUCCESS },
196 TESTIDS("545H, 546H"),
197 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (not ready)"),
198 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
200 { EInitializeCase, 0, EGL_SUCCESS },
201 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
202 { ECreateEndpointCase, 0, EGL_SUCCESS },
203 { EDrawContentCase, 0, EGL_SUCCESS },
204 { EContentUpdateCase, 0, EGL_SUCCESS },
205 { EBeginStreamingCase, 0, EGL_SUCCESS },
206 { EDestroyEndpointCase, 0, EGL_SUCCESS },
207 { ECreateEndpointCase, 0, EGL_SUCCESS },
208 // We should get bad access, as the endpoint is not ready!
209 { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS },
210 { EEndStreamingCase, 0, EGL_SUCCESS },
211 { EDestroyEndpointCase, 0, EGL_SUCCESS },
212 { ETerminateCase, 0, EGL_SUCCESS },
217 TESTIDS("545I, 546I"),
218 CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (ready)"),
219 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
221 { EInitializeCase, 0, EGL_SUCCESS },
222 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
223 { ECreateEndpointCase, 0, EGL_SUCCESS },
224 { EDrawContentCase, 0, EGL_SUCCESS },
225 { EContentUpdateCase, 0, EGL_SUCCESS },
226 { EBeginStreamingCase, 0, EGL_SUCCESS },
227 { EDestroyEndpointCase, 0, EGL_SUCCESS },
228 { ECreateEndpointCase, 0, EGL_SUCCESS },
229 { EDrawContentCase, 0, EGL_SUCCESS },
230 { EContentUpdateCase, 0, EGL_SUCCESS },
231 // We should get bad access, as the endpoint is not in a streaming block!
232 { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS },
233 { EEndStreamingCase, 0, EGL_SUCCESS },
234 { EDestroyEndpointCase, 0, EGL_SUCCESS },
235 { ETerminateCase, 0, EGL_SUCCESS },
241 static const TTestCase KStreamingBadParameterCases[] =
245 CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: Test eglEndpointBeginStreaming bad parameter variations"),
246 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
248 { EInitializeCase, 0, EGL_SUCCESS },
249 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
250 { ECreateEndpointCase, 0, EGL_SUCCESS },
251 { EDrawContentCase, 0, EGL_SUCCESS },
252 { EContentUpdateCase, 0, EGL_SUCCESS },
253 // Bad display on it's own.
254 { EBeginStreamingCase, EUseBadDisplay, EGL_BAD_DISPLAY },
255 // Bad display should be priority over the bad endpoint
256 { EBeginStreamingCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
257 // Bad endpoint should result in "BAD_ENDPOINT" error.
258 { EBeginStreamingCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
259 { EEndStreamingCase, 0, EGL_SUCCESS },
260 { EDestroyEndpointCase, 0, EGL_SUCCESS },
261 { ETerminateCase, 0, EGL_SUCCESS },
267 CASETITLE("Functional: Negative: eglEndpointEndStreamingNOK with Bad Parameters: Test eglEndpointEndStreaming bad parameter variations"),
268 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
270 { EInitializeCase, 0, EGL_SUCCESS },
271 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
272 { ECreateEndpointCase, 0, EGL_SUCCESS },
273 { EDrawContentCase, 0, EGL_SUCCESS },
274 { EContentUpdateCase, 0, EGL_SUCCESS },
275 // Bad display on it's own.
276 { EEndStreamingCase, EUseBadDisplay, EGL_BAD_DISPLAY },
277 // Bad display should be priority over the bad endpoint
278 { EEndStreamingCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
279 { EEndStreamingCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
280 { EEndStreamingCase, 0, EGL_SUCCESS },
281 { EDestroyEndpointCase, 0, EGL_SUCCESS },
282 { ETerminateCase, 0, EGL_SUCCESS },
288 static const TTestCase KStreamingNegativeCases[] =
292 CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: eglEndpointBeginStreaming with no contentupdate"),
293 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
295 { EInitializeCase, 0, EGL_SUCCESS },
296 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
297 { ECreateEndpointCase, 0, EGL_SUCCESS },
298 { EBeginStreamingCase, EExpectError, EGL_BAD_ACCESS },
299 { EDrawContentCase, 0, EGL_SUCCESS },
300 { EContentUpdateCase, 0, EGL_SUCCESS },
301 { EBeginStreamingCase, 0, EGL_SUCCESS },
302 { EDestroyEndpointCase, 0, EGL_SUCCESS },
303 { ETerminateCase, 0, EGL_SUCCESS },
309 static const TTestCases KTestCases[] =
311 TestCase(KStreamingPositiveCases),
312 TestCase(KStreamingBadParameterCases),
313 TestCase(KStreamingNegativeCases),
316 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
318 CEglTest_LocalTestStep_EndpointStreaming::CEglTest_LocalTestStep_EndpointStreaming():
319 CEgltest_Local_Engine(KTestCases, KNumberTestCases)