os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointdirtyarea.cpp
First public contribution.
1 // Copyright (c) 2010 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.
14 // Testing of eglEndpointDirtyAreaNOK functionality.
20 @internalComponent - Internal Symbian test code
23 #include "egltest_endpointdirtyarea.h"
25 static const TTestCase KDirtyAreaPositiveCases[] =
29 CASETITLE("Functional: Positive: eglGetEndpointDirtyArea basic test."),
30 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
32 { EInitializeCase, 0, EGL_SUCCESS },
33 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
34 { ECreateEndpointCase, 0, EGL_SUCCESS },
35 { EDrawContentCase, 0, EGL_SUCCESS },
36 { EContentUpdateCase, 0, EGL_SUCCESS },
37 { EBeginStreamingCase, 0, EGL_SUCCESS },
38 { EAcquireImageCase, 0, EGL_SUCCESS },
39 { EGetEndpointDirtyAreaCase, 0, EGL_SUCCESS, 0, 0, 0, 1 },
40 { EReleaseImageCase, 0, EGL_SUCCESS },
41 { EDestroyEndpointCase, 0, EGL_SUCCESS },
42 { ETerminateCase, 0, EGL_SUCCESS },
48 CASETITLE("Functional: Positive: eglGetEndpointDirtyArea simple working test - collapse area."),
49 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
51 { EInitializeCase, 0, EGL_SUCCESS },
52 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
53 { ECreateEndpointCase, 0, EGL_SUCCESS },
54 { EDrawContentCase, 0, EGL_SUCCESS },
55 { EContentUpdateCase, 0, EGL_SUCCESS },
56 { EBeginStreamingCase, 0, EGL_SUCCESS },
57 { EAcquireImageCase, 0, EGL_SUCCESS },
58 { EGetEndpointDirtyAreaCase, EUseCollapseArea, EGL_SUCCESS, 0, 0, 0, 2 },
59 { EReleaseImageCase, 0, EGL_SUCCESS },
60 { EDestroyEndpointCase, 0, EGL_SUCCESS },
61 { ETerminateCase, 0, EGL_SUCCESS },
67 CASETITLE("Functional: Positive: eglGetEndpointDirtyArea - check number of rects avialable"),
68 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
70 { EInitializeCase, 0, EGL_SUCCESS },
71 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
72 { ECreateEndpointCase, 0, EGL_SUCCESS },
73 { EDrawContentCase, 0, EGL_SUCCESS },
74 { EContentUpdateCase, 0, EGL_SUCCESS },
75 { EBeginStreamingCase, 0, EGL_SUCCESS },
76 { EAcquireImageCase, 0, EGL_SUCCESS },
77 { EGetEndpointDirtyAreaCase, EUseNullRects, EGL_SUCCESS, 0, 0, 0, 0 },
78 { EReleaseImageCase, 0, EGL_SUCCESS },
79 { EDestroyEndpointCase, 0, EGL_SUCCESS },
80 { ETerminateCase, 0, EGL_SUCCESS },
85 static const TTestCase KDirtyAreaNegativeCases[] =
89 CASETITLE("Functional: Negative: eglRequestNotification bad parameter test."),
90 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
92 { EInitializeCase, 0, EGL_SUCCESS },
93 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
94 { ECreateEndpointCase, 0, EGL_SUCCESS },
95 { EDrawContentCase, 0, EGL_SUCCESS },
96 { EContentUpdateCase, 0, EGL_SUCCESS },
97 { EBeginStreamingCase, 0, EGL_SUCCESS },
98 { EAcquireImageCase, 0, EGL_SUCCESS },
100 { EGetEndpointDirtyAreaCase, EUseBadDisplay, EGL_BAD_DISPLAY },
101 { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
102 { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadRects, EGL_BAD_DISPLAY },
103 { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadEndpoint | EUseBadRects, EGL_BAD_DISPLAY },
104 { EGetEndpointDirtyAreaCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
105 { EGetEndpointDirtyAreaCase, EUseBadRects, EGL_BAD_PARAMETER, 0, 0, 0, 1 },
106 // All zeros, but not NULL rects -> bad parameter error.
107 { EGetEndpointDirtyAreaCase, EExpectError, EGL_BAD_PARAMETER, 0, 0, 0, 0 },
108 { EDestroyEndpointCase, 0, EGL_SUCCESS },
109 { ETerminateCase, 0, EGL_SUCCESS },
115 CASETITLE("Functional: Negative: eglRequestNotification no acquired image."),
116 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
118 { EInitializeCase, 0, EGL_SUCCESS },
119 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
120 { ECreateEndpointCase, 0, EGL_SUCCESS },
121 { EDrawContentCase, 0, EGL_SUCCESS },
122 { EContentUpdateCase, 0, EGL_SUCCESS },
123 { EBeginStreamingCase, 0, EGL_SUCCESS },
124 { EGetEndpointDirtyAreaCase, EExpectError, EGL_BAD_ACCESS, 0, 0, 0, 1 },
125 { EGetEndpointDirtyAreaCase, EUseNullRects|EExpectError, EGL_BAD_ACCESS, 0, 0, 0, 0 },
126 { EDestroyEndpointCase, 0, EGL_SUCCESS },
127 { ETerminateCase, 0, EGL_SUCCESS },
135 static const TTestCases KTestCases[] =
137 TestCase(KDirtyAreaPositiveCases),
138 TestCase(KDirtyAreaNegativeCases),
141 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
143 CEglTest_LocalTestStep_EndpointDirtyArea::CEglTest_LocalTestStep_EndpointDirtyArea():
144 CEgltest_Local_Engine(KTestCases, KNumberTestCases)