os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointacquire_local.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointacquire_local.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,519 @@
     1.4 +// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @test
    1.22 + @internalComponent - Internal Symbian test code
    1.23 +*/
    1.24 +
    1.25 +#include "egltest_endpointacquire.h"
    1.26 +
    1.27 +
    1.28 +static const TTestCase KAcquirePositiveCases[] =
    1.29 +{
    1.30 +    // Test "working case"
    1.31 +    {
    1.32 +        TESTIDS("547A"),
    1.33 +        CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Basic Working case"),
    1.34 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    1.35 +        {
    1.36 +        { EInitializeCase,      0, EGL_SUCCESS },
    1.37 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
    1.38 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
    1.39 +        { EDrawContentCase,     0, EGL_SUCCESS },
    1.40 +        { EContentUpdateCase,   0, EGL_SUCCESS },
    1.41 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
    1.42 +        { EAcquireImageCase,    0, EGL_SUCCESS },
    1.43 +        { ECompareImageCase,    0, EGL_SUCCESS },
    1.44 +        { EReleaseImageCase,    0, EGL_SUCCESS },
    1.45 +        { EEndStreamingCase,    0, EGL_SUCCESS },
    1.46 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
    1.47 +        { ETerminateCase,       0, EGL_SUCCESS },
    1.48 +        { EFinishedCase }
    1.49 +        },
    1.50 +    },
    1.51 +    // Positive: Acquire twice with release
    1.52 +    {
    1.53 +        TESTIDS("547B"),
    1.54 +        CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire twice (with release)"),
    1.55 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    1.56 +        {
    1.57 +        { EInitializeCase,      0, EGL_SUCCESS },
    1.58 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
    1.59 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
    1.60 +        { EDrawContentCase,     0, EGL_SUCCESS },
    1.61 +        { EContentUpdateCase,   0, EGL_SUCCESS },
    1.62 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
    1.63 +        { EAcquireImageCase,    0, EGL_SUCCESS },
    1.64 +        { ECompareImageCase,    0, EGL_SUCCESS },
    1.65 +        { EDrawContentCase,     0, EGL_SUCCESS },
    1.66 +        { EContentUpdateCase,   ENoSync, EGL_SUCCESS },
    1.67 +        { EReleaseImageCase,    0, EGL_SUCCESS },
    1.68 +        { EAcquireImageCase,    0, EGL_SUCCESS },
    1.69 +        { ECompareImageCase,    0, EGL_SUCCESS },
    1.70 +        { EReleaseImageCase,    0, EGL_SUCCESS },
    1.71 +        { EEndStreamingCase,    0, EGL_SUCCESS },
    1.72 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
    1.73 +        { ETerminateCase,       0, EGL_SUCCESS },
    1.74 +        { EFinishedCase }
    1.75 +        },
    1.76 +    },
    1.77 +    {
    1.78 +        TESTIDS("547C"),
    1.79 +        CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Two endpoints, acquire from each of them"),
    1.80 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    1.81 +        {
    1.82 +        { EInitializeCase,      0, EGL_SUCCESS },
    1.83 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface},
    1.84 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 1, EStandardSurface },
    1.85 +        { ECreateEndpointCase,  0, EGL_SUCCESS, 0, 0},      // Endpoint 0, image(surface) 0
    1.86 +        { ECreateEndpointCase,  0, EGL_SUCCESS, 1, 1},      // Endpoint 1, image(surface) 1
    1.87 +        { EDrawContentCase,     0, EGL_SUCCESS, 0, 0 },     // Surface 0, Image 0
    1.88 +        { EContentUpdateCase,   0, EGL_SUCCESS, 0 },        // Surface 0
    1.89 +        { EDrawContentCase,     0, EGL_SUCCESS, 1, 1 },     // Surface 1, Image 1
    1.90 +        { EContentUpdateCase,   0, EGL_SUCCESS, 1 },        // Surface 1
    1.91 +        { EBeginStreamingCase,  0, EGL_SUCCESS, 0 },        // Endpoint 0.
    1.92 +        { EBeginStreamingCase,  0, EGL_SUCCESS, 1 },        // Endpoint 1.
    1.93 +        { EAcquireImageCase,    0, EGL_SUCCESS, 1 },        // Endpoint 1
    1.94 +        { EAcquireImageCase,    0, EGL_SUCCESS, 0 },        // Endpoint 0
    1.95 +        { ECompareImageCase,    0, EGL_SUCCESS, 0, 0 },     // eglImage 0, image 0
    1.96 +        { ECompareImageCase,    0, EGL_SUCCESS, 1, 1 },     // eglImage 1, image 1
    1.97 +        { EReleaseImageCase,    0, EGL_SUCCESS, 0, 0 },     // Endpoint 0, image 0
    1.98 +        { EReleaseImageCase,    0, EGL_SUCCESS, 1, 1 },     // Endpoint 1, image 1
    1.99 +        { EEndStreamingCase,    0, EGL_SUCCESS, 0 },        // Endpoint 0
   1.100 +        { EEndStreamingCase,    0, EGL_SUCCESS, 1 },        // Endpoint 1
   1.101 +        { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },        // Endpoint 0
   1.102 +        { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },        // Endpoint 1
   1.103 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.104 +        { EFinishedCase }
   1.105 +        },
   1.106 +    },
   1.107 +    // Positive: Acquire, early destroy...
   1.108 +    {
   1.109 +        TESTIDS("547D"),
   1.110 +        CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire and destroy without release"),
   1.111 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.112 +        {
   1.113 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.114 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.115 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.116 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.117 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.118 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.119 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.120 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.121 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.122 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.123 +        { EFinishedCase }
   1.124 +        },
   1.125 +    },
   1.126 +    // Positive: Acquire, early endstreaming...
   1.127 +    {
   1.128 +        TESTIDS("547E"),
   1.129 +        CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire and endstreaming without release"),
   1.130 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.131 +        {
   1.132 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.133 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.134 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.135 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.136 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.137 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.138 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.139 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.140 +        { EEndStreamingCase,    0, EGL_SUCCESS },
   1.141 +        { EBeginStreamingCase,  0, EGL_SUCCESS }, // We need to acquire again to see that it actually works correctly.
   1.142 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.143 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.144 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.145 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.146 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.147 +        { EFinishedCase }
   1.148 +        },
   1.149 +    },
   1.150 +};
   1.151 +
   1.152 +
   1.153 +static const TTestCase KAcquireNegativeCases[] =
   1.154 +{
   1.155 +    {
   1.156 +        TESTIDS("555A"),
   1.157 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Not ready"),
   1.158 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.159 +        {
   1.160 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.161 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.162 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.163 +        { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   1.164 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.165 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.166 +        { EFinishedCase }
   1.167 +        },
   1.168 +    },
   1.169 +    {
   1.170 +        TESTIDS("555B"),
   1.171 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Not streaming"),
   1.172 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.173 +        {
   1.174 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.175 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.176 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.177 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.178 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.179 +        { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   1.180 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.181 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.182 +        { EFinishedCase }
   1.183 +        },
   1.184 +    },
   1.185 +    // Negative: Acquire twice with no release
   1.186 +    {
   1.187 +        TESTIDS("555C"),
   1.188 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Acquire twice (no release)"),
   1.189 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.190 +        {
   1.191 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.192 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.193 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.194 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.195 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.196 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.197 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.198 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.199 +        // Note that when a bad acquire is done, the eglimage value is not stored.
   1.200 +        // so we can still use the same image slot for the release later on.
   1.201 +        { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   1.202 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.203 +        { EEndStreamingCase,    0, EGL_SUCCESS },
   1.204 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.205 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.206 +        { EFinishedCase }
   1.207 +        },
   1.208 +    },
   1.209 +    // Negative: Release bad eglImage then release the proper one, and acquire another (to ensure all worked).
   1.210 +    {
   1.211 +        TESTIDS("555D"),
   1.212 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: release bad image then release correct one"),
   1.213 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.214 +        {
   1.215 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.216 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.217 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.218 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.219 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.220 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.221 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.222 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.223 +        { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   1.224 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.225 +        { EEndStreamingCase,    0, EGL_SUCCESS },
   1.226 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.227 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.228 +        { EFinishedCase }
   1.229 +        },
   1.230 +    }
   1.231 +};
   1.232 +
   1.233 +static const TTestCase KAcquireBadParamCases[] =
   1.234 +{
   1.235 +    {
   1.236 +        TESTIDS("555E"),
   1.237 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Not Ready state)"),
   1.238 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.239 +        {
   1.240 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.241 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.242 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.243 +        { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   1.244 +        { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   1.245 +        { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   1.246 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.247 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.248 +        { EFinishedCase },
   1.249 +        },
   1.250 +    },
   1.251 +    {
   1.252 +        TESTIDS("555F"),
   1.253 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Ready state)"),
   1.254 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.255 +        {
   1.256 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.257 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.258 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.259 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.260 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.261 +        { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   1.262 +        { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   1.263 +        { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   1.264 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.265 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.266 +        { EFinishedCase },
   1.267 +        },
   1.268 +    },
   1.269 +    {
   1.270 +        TESTIDS("555G"),
   1.271 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Streaming state)"),
   1.272 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.273 +        {
   1.274 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.275 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.276 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.277 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.278 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.279 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.280 +        { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   1.281 +        { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   1.282 +        { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   1.283 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.284 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.285 +        { EFinishedCase },
   1.286 +        },
   1.287 +    },
   1.288 +    {
   1.289 +        TESTIDS("555H"),
   1.290 +        CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Image Acquired state)"),
   1.291 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.292 +        {
   1.293 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.294 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.295 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.296 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.297 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.298 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.299 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.300 +        { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   1.301 +        { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   1.302 +        { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   1.303 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.304 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.305 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.306 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.307 +        { EFinishedCase },
   1.308 +        },
   1.309 +    },
   1.310 +};
   1.311 +
   1.312 +
   1.313 +static const TTestCase KReleaseBadParamCases[] =
   1.314 +{
   1.315 +    {
   1.316 +        TESTIDS("556A"),
   1.317 +        CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Not Ready state)"),
   1.318 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.319 +        {
   1.320 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.321 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.322 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.323 +        { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   1.324 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   1.325 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.326 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.327 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.328 +        { EFinishedCase },
   1.329 +        },
   1.330 +    },
   1.331 +    {
   1.332 +        TESTIDS("556B"),
   1.333 +        CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Ready state)"),
   1.334 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.335 +        {
   1.336 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.337 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.338 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.339 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.340 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.341 +        { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   1.342 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   1.343 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.344 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.345 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.346 +        { EFinishedCase },
   1.347 +        },
   1.348 +    },
   1.349 +    {
   1.350 +        TESTIDS("556C"),
   1.351 +        CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Bad Parameters(Streaming state)"),
   1.352 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.353 +        {
   1.354 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.355 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.356 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.357 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.358 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.359 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.360 +        { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   1.361 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   1.362 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.363 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.364 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.365 +        { EFinishedCase },
   1.366 +        },
   1.367 +    },
   1.368 +    {
   1.369 +        TESTIDS("556D"),
   1.370 +        CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Image Acquired state)"),
   1.371 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.372 +        {
   1.373 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.374 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.375 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.376 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.377 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.378 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.379 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.380 +        { EReleaseImageCase,    EUseBadDisplay, EGL_BAD_DISPLAY },
   1.381 +        { EReleaseImageCase,    EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
   1.382 +        { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   1.383 +        { EReleaseImageCase,    EUseBadApi, EGL_BAD_PARAMETER },
   1.384 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.385 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEglImage, EGL_BAD_DISPLAY },
   1.386 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadApi, EGL_BAD_DISPLAY },
   1.387 +        { EReleaseImageCase,    EUseBadEglImage | EUseBadApi, EGL_BAD_PARAMETER },
   1.388 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadEglImage, EGL_BAD_DISPLAY },
   1.389 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadApi, EGL_BAD_DISPLAY },
   1.390 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEglImage | EUseBadApi, EGL_BAD_DISPLAY },
   1.391 +        { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadEglImage | EUseBadApi, EGL_BAD_DISPLAY },
   1.392 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.393 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.394 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.395 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.396 +        { EFinishedCase },
   1.397 +        },
   1.398 +    },
   1.399 +};
   1.400 +
   1.401 +
   1.402 +static const TTestCase KReleasePositiveCases[] =
   1.403 +{
   1.404 +    {
   1.405 +        TESTIDS("548A"),
   1.406 +        CASETITLE("Functional: Positive: eglReleaseImageNOK with Valid Parameters: Simple acquire then release"),
   1.407 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.408 +        {
   1.409 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.410 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.411 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.412 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.413 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.414 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.415 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.416 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.417 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.418 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.419 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.420 +        { EFinishedCase },
   1.421 +        },
   1.422 +    },
   1.423 +    {
   1.424 +        TESTIDS("548B"),
   1.425 +        CASETITLE("Functional: Positive: eglReleaseImageNOK with Valid Parameters: Acquire, release twice"),
   1.426 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.427 +        {
   1.428 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.429 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.430 +        { ECreateEndpointCase,  0, EGL_SUCCESS },
   1.431 +        { EDrawContentCase,     0, EGL_SUCCESS },
   1.432 +        { EContentUpdateCase,   0, EGL_SUCCESS },
   1.433 +        { EBeginStreamingCase,  0, EGL_SUCCESS },
   1.434 +        { EAcquireImageCase,    0, EGL_SUCCESS },
   1.435 +        { ECompareImageCase,    0, EGL_SUCCESS },
   1.436 +        { EReleaseImageCase,    0, EGL_SUCCESS },
   1.437 +        // Should fail.
   1.438 +        { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER },
   1.439 +        { EDestroyEndpointCase, 0, EGL_SUCCESS },
   1.440 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.441 +        { EFinishedCase },
   1.442 +        },
   1.443 +    },
   1.444 +};
   1.445 +
   1.446 +static const TTestCase KReleaseNegativeCases[] =
   1.447 +{
   1.448 +    {
   1.449 +        TESTIDS("548C"),
   1.450 +        CASETITLE("Functional: Negative: eglReleaseImageNOK with Valid Parameters: Two EPs, acquire, then release on wrong EP."),
   1.451 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.452 +        {
   1.453 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.454 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.455 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 1, EStandardSurface },
   1.456 +        { ECreateEndpointCase,  0, EGL_SUCCESS, 0, 0 },
   1.457 +        { ECreateEndpointCase,  0, EGL_SUCCESS, 1, 1 },
   1.458 +        { EDrawContentCase,     0, EGL_SUCCESS, 0, 0 },
   1.459 +        { EContentUpdateCase,   0, EGL_SUCCESS, 0 },
   1.460 +        { EDrawContentCase,     0, EGL_SUCCESS, 1, 1 },
   1.461 +        { EContentUpdateCase,   0, EGL_SUCCESS, 1 },
   1.462 +        { EBeginStreamingCase,  0, EGL_SUCCESS, 0 },
   1.463 +        { EBeginStreamingCase,  0, EGL_SUCCESS, 1 },
   1.464 +        { EAcquireImageCase,    0, EGL_SUCCESS, 0, 0 },
   1.465 +        { EAcquireImageCase,    0, EGL_SUCCESS, 1, 1 },
   1.466 +        // Swapping the release of the image - should fail.
   1.467 +        { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER, 0, 1 },
   1.468 +        { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER, 1, 0 },
   1.469 +        // Check that the originally acquired images are still there...
   1.470 +        { ECompareImageCase,    0, EGL_SUCCESS, 0, 0 },
   1.471 +        { ECompareImageCase,    0, EGL_SUCCESS, 1, 1 },
   1.472 +        // Now do it the right way around
   1.473 +        { EReleaseImageCase,    0, EGL_SUCCESS, 1, 1 },
   1.474 +        { EReleaseImageCase,    0, EGL_SUCCESS, 0, 0 },
   1.475 +        { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
   1.476 +        { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
   1.477 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.478 +        { EFinishedCase },
   1.479 +        },
   1.480 +    },
   1.481 +    {
   1.482 +        TESTIDS("619"),
   1.483 +        CASETITLE("Functional: Negative: eglDestroyImageKHR can not be used for images acquired from endpoint."),
   1.484 +        SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   1.485 +        {
   1.486 +        { EInitializeCase,      0, EGL_SUCCESS },
   1.487 +        { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   1.488 +        { ECreateEndpointCase,  0, EGL_SUCCESS, },
   1.489 +        { EDrawContentCase,     0, EGL_SUCCESS, },
   1.490 +        { EContentUpdateCase,   0, EGL_SUCCESS, },
   1.491 +        { EBeginStreamingCase,  0, EGL_SUCCESS, },
   1.492 +        { EAcquireImageCase,    0, EGL_SUCCESS, },
   1.493 +        { EDestroyEglImageCase, EExpectError, EGL_BAD_ACCESS },
   1.494 +        // Compare Image to make sure it's still "there".
   1.495 +        { ECompareImageCase,    0, EGL_SUCCESS, },
   1.496 +        { EReleaseImageCase,    0, EGL_SUCCESS, },
   1.497 +        { EDestroyEndpointCase, 0, EGL_SUCCESS, },
   1.498 +        { ETerminateCase,       0, EGL_SUCCESS },
   1.499 +        { EFinishedCase },
   1.500 +        },
   1.501 +    },
   1.502 +
   1.503 +};
   1.504 +
   1.505 +
   1.506 +static const TTestCases KTestCases[] =
   1.507 +{
   1.508 +        TestCase(KAcquirePositiveCases),
   1.509 +        TestCase(KAcquireNegativeCases),
   1.510 +        TestCase(KAcquireBadParamCases),
   1.511 +        TestCase(KReleasePositiveCases),
   1.512 +        TestCase(KReleaseBadParamCases),
   1.513 +        TestCase(KReleaseNegativeCases),
   1.514 +};
   1.515 +
   1.516 +const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   1.517 +
   1.518 +
   1.519 +CEglTest_LocalTestStep_EndpointAcquire::CEglTest_LocalTestStep_EndpointAcquire():
   1.520 +    CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   1.521 +    {
   1.522 +    }