os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointacquire_local.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2009-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent - Internal Symbian test code
    20 */
    21 
    22 #include "egltest_endpointacquire.h"
    23 
    24 
    25 static const TTestCase KAcquirePositiveCases[] =
    26 {
    27     // Test "working case"
    28     {
    29         TESTIDS("547A"),
    30         CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Basic Working case"),
    31         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    32         {
    33         { EInitializeCase,      0, EGL_SUCCESS },
    34         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
    35         { ECreateEndpointCase,  0, EGL_SUCCESS },
    36         { EDrawContentCase,     0, EGL_SUCCESS },
    37         { EContentUpdateCase,   0, EGL_SUCCESS },
    38         { EBeginStreamingCase,  0, EGL_SUCCESS },
    39         { EAcquireImageCase,    0, EGL_SUCCESS },
    40         { ECompareImageCase,    0, EGL_SUCCESS },
    41         { EReleaseImageCase,    0, EGL_SUCCESS },
    42         { EEndStreamingCase,    0, EGL_SUCCESS },
    43         { EDestroyEndpointCase, 0, EGL_SUCCESS },
    44         { ETerminateCase,       0, EGL_SUCCESS },
    45         { EFinishedCase }
    46         },
    47     },
    48     // Positive: Acquire twice with release
    49     {
    50         TESTIDS("547B"),
    51         CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire twice (with release)"),
    52         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    53         {
    54         { EInitializeCase,      0, EGL_SUCCESS },
    55         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
    56         { ECreateEndpointCase,  0, EGL_SUCCESS },
    57         { EDrawContentCase,     0, EGL_SUCCESS },
    58         { EContentUpdateCase,   0, EGL_SUCCESS },
    59         { EBeginStreamingCase,  0, EGL_SUCCESS },
    60         { EAcquireImageCase,    0, EGL_SUCCESS },
    61         { ECompareImageCase,    0, EGL_SUCCESS },
    62         { EDrawContentCase,     0, EGL_SUCCESS },
    63         { EContentUpdateCase,   ENoSync, EGL_SUCCESS },
    64         { EReleaseImageCase,    0, EGL_SUCCESS },
    65         { EAcquireImageCase,    0, EGL_SUCCESS },
    66         { ECompareImageCase,    0, EGL_SUCCESS },
    67         { EReleaseImageCase,    0, EGL_SUCCESS },
    68         { EEndStreamingCase,    0, EGL_SUCCESS },
    69         { EDestroyEndpointCase, 0, EGL_SUCCESS },
    70         { ETerminateCase,       0, EGL_SUCCESS },
    71         { EFinishedCase }
    72         },
    73     },
    74     {
    75         TESTIDS("547C"),
    76         CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Two endpoints, acquire from each of them"),
    77         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
    78         {
    79         { EInitializeCase,      0, EGL_SUCCESS },
    80         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface},
    81         { ECreateSurfaceCase,   0, EGL_SUCCESS, 1, EStandardSurface },
    82         { ECreateEndpointCase,  0, EGL_SUCCESS, 0, 0},      // Endpoint 0, image(surface) 0
    83         { ECreateEndpointCase,  0, EGL_SUCCESS, 1, 1},      // Endpoint 1, image(surface) 1
    84         { EDrawContentCase,     0, EGL_SUCCESS, 0, 0 },     // Surface 0, Image 0
    85         { EContentUpdateCase,   0, EGL_SUCCESS, 0 },        // Surface 0
    86         { EDrawContentCase,     0, EGL_SUCCESS, 1, 1 },     // Surface 1, Image 1
    87         { EContentUpdateCase,   0, EGL_SUCCESS, 1 },        // Surface 1
    88         { EBeginStreamingCase,  0, EGL_SUCCESS, 0 },        // Endpoint 0.
    89         { EBeginStreamingCase,  0, EGL_SUCCESS, 1 },        // Endpoint 1.
    90         { EAcquireImageCase,    0, EGL_SUCCESS, 1 },        // Endpoint 1
    91         { EAcquireImageCase,    0, EGL_SUCCESS, 0 },        // Endpoint 0
    92         { ECompareImageCase,    0, EGL_SUCCESS, 0, 0 },     // eglImage 0, image 0
    93         { ECompareImageCase,    0, EGL_SUCCESS, 1, 1 },     // eglImage 1, image 1
    94         { EReleaseImageCase,    0, EGL_SUCCESS, 0, 0 },     // Endpoint 0, image 0
    95         { EReleaseImageCase,    0, EGL_SUCCESS, 1, 1 },     // Endpoint 1, image 1
    96         { EEndStreamingCase,    0, EGL_SUCCESS, 0 },        // Endpoint 0
    97         { EEndStreamingCase,    0, EGL_SUCCESS, 1 },        // Endpoint 1
    98         { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },        // Endpoint 0
    99         { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },        // Endpoint 1
   100         { ETerminateCase,       0, EGL_SUCCESS },
   101         { EFinishedCase }
   102         },
   103     },
   104     // Positive: Acquire, early destroy...
   105     {
   106         TESTIDS("547D"),
   107         CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire and destroy without release"),
   108         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   109         {
   110         { EInitializeCase,      0, EGL_SUCCESS },
   111         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   112         { ECreateEndpointCase,  0, EGL_SUCCESS },
   113         { EDrawContentCase,     0, EGL_SUCCESS },
   114         { EContentUpdateCase,   0, EGL_SUCCESS },
   115         { EBeginStreamingCase,  0, EGL_SUCCESS },
   116         { EAcquireImageCase,    0, EGL_SUCCESS },
   117         { ECompareImageCase,    0, EGL_SUCCESS },
   118         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   119         { ETerminateCase,       0, EGL_SUCCESS },
   120         { EFinishedCase }
   121         },
   122     },
   123     // Positive: Acquire, early endstreaming...
   124     {
   125         TESTIDS("547E"),
   126         CASETITLE("Functional: Positive: eglAcquireImageNOK with Valid Parameters: Acquire and endstreaming without release"),
   127         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   128         {
   129         { EInitializeCase,      0, EGL_SUCCESS },
   130         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   131         { ECreateEndpointCase,  0, EGL_SUCCESS },
   132         { EDrawContentCase,     0, EGL_SUCCESS },
   133         { EContentUpdateCase,   0, EGL_SUCCESS },
   134         { EBeginStreamingCase,  0, EGL_SUCCESS },
   135         { EAcquireImageCase,    0, EGL_SUCCESS },
   136         { ECompareImageCase,    0, EGL_SUCCESS },
   137         { EEndStreamingCase,    0, EGL_SUCCESS },
   138         { EBeginStreamingCase,  0, EGL_SUCCESS }, // We need to acquire again to see that it actually works correctly.
   139         { EAcquireImageCase,    0, EGL_SUCCESS },
   140         { ECompareImageCase,    0, EGL_SUCCESS },
   141         { EReleaseImageCase,    0, EGL_SUCCESS },
   142         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   143         { ETerminateCase,       0, EGL_SUCCESS },
   144         { EFinishedCase }
   145         },
   146     },
   147 };
   148 
   149 
   150 static const TTestCase KAcquireNegativeCases[] =
   151 {
   152     {
   153         TESTIDS("555A"),
   154         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Not ready"),
   155         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   156         {
   157         { EInitializeCase,      0, EGL_SUCCESS },
   158         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   159         { ECreateEndpointCase,  0, EGL_SUCCESS },
   160         { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   161         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   162         { ETerminateCase,       0, EGL_SUCCESS },
   163         { EFinishedCase }
   164         },
   165     },
   166     {
   167         TESTIDS("555B"),
   168         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Not streaming"),
   169         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   170         {
   171         { EInitializeCase,      0, EGL_SUCCESS },
   172         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   173         { ECreateEndpointCase,  0, EGL_SUCCESS },
   174         { EDrawContentCase,     0, EGL_SUCCESS },
   175         { EContentUpdateCase,   0, EGL_SUCCESS },
   176         { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   177         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   178         { ETerminateCase,       0, EGL_SUCCESS },
   179         { EFinishedCase }
   180         },
   181     },
   182     // Negative: Acquire twice with no release
   183     {
   184         TESTIDS("555C"),
   185         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Acquire twice (no release)"),
   186         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   187         {
   188         { EInitializeCase,      0, EGL_SUCCESS },
   189         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   190         { ECreateEndpointCase,  0, EGL_SUCCESS },
   191         { EDrawContentCase,     0, EGL_SUCCESS },
   192         { EContentUpdateCase,   0, EGL_SUCCESS },
   193         { EBeginStreamingCase,  0, EGL_SUCCESS },
   194         { EAcquireImageCase,    0, EGL_SUCCESS },
   195         { ECompareImageCase,    0, EGL_SUCCESS },
   196         // Note that when a bad acquire is done, the eglimage value is not stored.
   197         // so we can still use the same image slot for the release later on.
   198         { EAcquireImageCase,    EExpectError, EGL_BAD_ACCESS },
   199         { EReleaseImageCase,    0, EGL_SUCCESS },
   200         { EEndStreamingCase,    0, EGL_SUCCESS },
   201         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   202         { ETerminateCase,       0, EGL_SUCCESS },
   203         { EFinishedCase }
   204         },
   205     },
   206     // Negative: Release bad eglImage then release the proper one, and acquire another (to ensure all worked).
   207     {
   208         TESTIDS("555D"),
   209         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: release bad image then release correct one"),
   210         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   211         {
   212         { EInitializeCase,      0, EGL_SUCCESS },
   213         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   214         { ECreateEndpointCase,  0, EGL_SUCCESS },
   215         { EDrawContentCase,     0, EGL_SUCCESS },
   216         { EContentUpdateCase,   0, EGL_SUCCESS },
   217         { EBeginStreamingCase,  0, EGL_SUCCESS },
   218         { EAcquireImageCase,    0, EGL_SUCCESS },
   219         { ECompareImageCase,    0, EGL_SUCCESS },
   220         { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   221         { EReleaseImageCase,    0, EGL_SUCCESS },
   222         { EEndStreamingCase,    0, EGL_SUCCESS },
   223         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   224         { ETerminateCase,       0, EGL_SUCCESS },
   225         { EFinishedCase }
   226         },
   227     }
   228 };
   229 
   230 static const TTestCase KAcquireBadParamCases[] =
   231 {
   232     {
   233         TESTIDS("555E"),
   234         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Not Ready state)"),
   235         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   236         {
   237         { EInitializeCase,      0, EGL_SUCCESS },
   238         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   239         { ECreateEndpointCase,  0, EGL_SUCCESS },
   240         { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   241         { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   242         { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   243         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   244         { ETerminateCase,       0, EGL_SUCCESS },
   245         { EFinishedCase },
   246         },
   247     },
   248     {
   249         TESTIDS("555F"),
   250         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Ready state)"),
   251         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   252         {
   253         { EInitializeCase,      0, EGL_SUCCESS },
   254         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   255         { ECreateEndpointCase,  0, EGL_SUCCESS },
   256         { EDrawContentCase,     0, EGL_SUCCESS },
   257         { EContentUpdateCase,   0, EGL_SUCCESS },
   258         { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   259         { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   260         { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   261         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   262         { ETerminateCase,       0, EGL_SUCCESS },
   263         { EFinishedCase },
   264         },
   265     },
   266     {
   267         TESTIDS("555G"),
   268         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Streaming state)"),
   269         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   270         {
   271         { EInitializeCase,      0, EGL_SUCCESS },
   272         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   273         { ECreateEndpointCase,  0, EGL_SUCCESS },
   274         { EDrawContentCase,     0, EGL_SUCCESS },
   275         { EContentUpdateCase,   0, EGL_SUCCESS },
   276         { EBeginStreamingCase,  0, EGL_SUCCESS },
   277         { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   278         { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   279         { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   280         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   281         { ETerminateCase,       0, EGL_SUCCESS },
   282         { EFinishedCase },
   283         },
   284     },
   285     {
   286         TESTIDS("555H"),
   287         CASETITLE("Functional: Negative: eglAcquireImageNOK with Bad Parameters: Various bad Parameters(Image Acquired state)"),
   288         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   289         {
   290         { EInitializeCase,      0, EGL_SUCCESS },
   291         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   292         { ECreateEndpointCase,  0, EGL_SUCCESS },
   293         { EDrawContentCase,     0, EGL_SUCCESS },
   294         { EContentUpdateCase,   0, EGL_SUCCESS },
   295         { EBeginStreamingCase,  0, EGL_SUCCESS },
   296         { EAcquireImageCase,    0, EGL_SUCCESS },
   297         { EAcquireImageCase,    EUseBadDisplay,  EGL_BAD_DISPLAY },
   298         { EAcquireImageCase,    EUseBadDisplay | EUseBadEndpoint,    EGL_BAD_DISPLAY },
   299         { EAcquireImageCase,    EUseBadEndpoint,  EGL_BAD_ENDPOINT_NOK },
   300         { ECompareImageCase,    0, EGL_SUCCESS },
   301         { EReleaseImageCase,    0, EGL_SUCCESS },
   302         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   303         { ETerminateCase,       0, EGL_SUCCESS },
   304         { EFinishedCase },
   305         },
   306     },
   307 };
   308 
   309 
   310 static const TTestCase KReleaseBadParamCases[] =
   311 {
   312     {
   313         TESTIDS("556A"),
   314         CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Not Ready state)"),
   315         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   316         {
   317         { EInitializeCase,      0, EGL_SUCCESS },
   318         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   319         { ECreateEndpointCase,  0, EGL_SUCCESS },
   320         { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   321         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   322         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   323         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   324         { ETerminateCase,       0, EGL_SUCCESS },
   325         { EFinishedCase },
   326         },
   327     },
   328     {
   329         TESTIDS("556B"),
   330         CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Ready state)"),
   331         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   332         {
   333         { EInitializeCase,      0, EGL_SUCCESS },
   334         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   335         { ECreateEndpointCase,  0, EGL_SUCCESS },
   336         { EDrawContentCase,     0, EGL_SUCCESS },
   337         { EContentUpdateCase,   0, EGL_SUCCESS },
   338         { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   339         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   340         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   341         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   342         { ETerminateCase,       0, EGL_SUCCESS },
   343         { EFinishedCase },
   344         },
   345     },
   346     {
   347         TESTIDS("556C"),
   348         CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Bad Parameters(Streaming state)"),
   349         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   350         {
   351         { EInitializeCase,      0, EGL_SUCCESS },
   352         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   353         { ECreateEndpointCase,  0, EGL_SUCCESS },
   354         { EDrawContentCase,     0, EGL_SUCCESS },
   355         { EContentUpdateCase,   0, EGL_SUCCESS },
   356         { EBeginStreamingCase,  0, EGL_SUCCESS },
   357         { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   358         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay, EGL_BAD_DISPLAY },
   359         { EReleaseImageCase,    EUseBadEglImage | EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   360         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   361         { ETerminateCase,       0, EGL_SUCCESS },
   362         { EFinishedCase },
   363         },
   364     },
   365     {
   366         TESTIDS("556D"),
   367         CASETITLE("Functional: Negative: eglReleaseImageNOK with Bad Parameters: Various bad Parameters(Image Acquired state)"),
   368         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   369         {
   370         { EInitializeCase,      0, EGL_SUCCESS },
   371         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   372         { ECreateEndpointCase,  0, EGL_SUCCESS },
   373         { EDrawContentCase,     0, EGL_SUCCESS },
   374         { EContentUpdateCase,   0, EGL_SUCCESS },
   375         { EBeginStreamingCase,  0, EGL_SUCCESS },
   376         { EAcquireImageCase,    0, EGL_SUCCESS },
   377         { EReleaseImageCase,    EUseBadDisplay, EGL_BAD_DISPLAY },
   378         { EReleaseImageCase,    EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
   379         { EReleaseImageCase,    EUseBadEglImage, EGL_BAD_PARAMETER },
   380         { EReleaseImageCase,    EUseBadApi, EGL_BAD_PARAMETER },
   381         { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   382         { EReleaseImageCase,    EUseBadDisplay | EUseBadEglImage, EGL_BAD_DISPLAY },
   383         { EReleaseImageCase,    EUseBadDisplay | EUseBadApi, EGL_BAD_DISPLAY },
   384         { EReleaseImageCase,    EUseBadEglImage | EUseBadApi, EGL_BAD_PARAMETER },
   385         { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadEglImage, EGL_BAD_DISPLAY },
   386         { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadApi, EGL_BAD_DISPLAY },
   387         { EReleaseImageCase,    EUseBadDisplay | EUseBadEglImage | EUseBadApi, EGL_BAD_DISPLAY },
   388         { EReleaseImageCase,    EUseBadDisplay | EUseBadEndpoint | EUseBadEglImage | EUseBadApi, EGL_BAD_DISPLAY },
   389         { ECompareImageCase,    0, EGL_SUCCESS },
   390         { EReleaseImageCase,    0, EGL_SUCCESS },
   391         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   392         { ETerminateCase,       0, EGL_SUCCESS },
   393         { EFinishedCase },
   394         },
   395     },
   396 };
   397 
   398 
   399 static const TTestCase KReleasePositiveCases[] =
   400 {
   401     {
   402         TESTIDS("548A"),
   403         CASETITLE("Functional: Positive: eglReleaseImageNOK with Valid Parameters: Simple acquire then release"),
   404         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   405         {
   406         { EInitializeCase,      0, EGL_SUCCESS },
   407         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   408         { ECreateEndpointCase,  0, EGL_SUCCESS },
   409         { EDrawContentCase,     0, EGL_SUCCESS },
   410         { EContentUpdateCase,   0, EGL_SUCCESS },
   411         { EBeginStreamingCase,  0, EGL_SUCCESS },
   412         { EAcquireImageCase,    0, EGL_SUCCESS },
   413         { ECompareImageCase,    0, EGL_SUCCESS },
   414         { EReleaseImageCase,    0, EGL_SUCCESS },
   415         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   416         { ETerminateCase,       0, EGL_SUCCESS },
   417         { EFinishedCase },
   418         },
   419     },
   420     {
   421         TESTIDS("548B"),
   422         CASETITLE("Functional: Positive: eglReleaseImageNOK with Valid Parameters: Acquire, release twice"),
   423         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   424         {
   425         { EInitializeCase,      0, EGL_SUCCESS },
   426         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   427         { ECreateEndpointCase,  0, EGL_SUCCESS },
   428         { EDrawContentCase,     0, EGL_SUCCESS },
   429         { EContentUpdateCase,   0, EGL_SUCCESS },
   430         { EBeginStreamingCase,  0, EGL_SUCCESS },
   431         { EAcquireImageCase,    0, EGL_SUCCESS },
   432         { ECompareImageCase,    0, EGL_SUCCESS },
   433         { EReleaseImageCase,    0, EGL_SUCCESS },
   434         // Should fail.
   435         { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER },
   436         { EDestroyEndpointCase, 0, EGL_SUCCESS },
   437         { ETerminateCase,       0, EGL_SUCCESS },
   438         { EFinishedCase },
   439         },
   440     },
   441 };
   442 
   443 static const TTestCase KReleaseNegativeCases[] =
   444 {
   445     {
   446         TESTIDS("548C"),
   447         CASETITLE("Functional: Negative: eglReleaseImageNOK with Valid Parameters: Two EPs, acquire, then release on wrong EP."),
   448         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   449         {
   450         { EInitializeCase,      0, EGL_SUCCESS },
   451         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   452         { ECreateSurfaceCase,   0, EGL_SUCCESS, 1, EStandardSurface },
   453         { ECreateEndpointCase,  0, EGL_SUCCESS, 0, 0 },
   454         { ECreateEndpointCase,  0, EGL_SUCCESS, 1, 1 },
   455         { EDrawContentCase,     0, EGL_SUCCESS, 0, 0 },
   456         { EContentUpdateCase,   0, EGL_SUCCESS, 0 },
   457         { EDrawContentCase,     0, EGL_SUCCESS, 1, 1 },
   458         { EContentUpdateCase,   0, EGL_SUCCESS, 1 },
   459         { EBeginStreamingCase,  0, EGL_SUCCESS, 0 },
   460         { EBeginStreamingCase,  0, EGL_SUCCESS, 1 },
   461         { EAcquireImageCase,    0, EGL_SUCCESS, 0, 0 },
   462         { EAcquireImageCase,    0, EGL_SUCCESS, 1, 1 },
   463         // Swapping the release of the image - should fail.
   464         { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER, 0, 1 },
   465         { EReleaseImageCase,    EExpectError, EGL_BAD_PARAMETER, 1, 0 },
   466         // Check that the originally acquired images are still there...
   467         { ECompareImageCase,    0, EGL_SUCCESS, 0, 0 },
   468         { ECompareImageCase,    0, EGL_SUCCESS, 1, 1 },
   469         // Now do it the right way around
   470         { EReleaseImageCase,    0, EGL_SUCCESS, 1, 1 },
   471         { EReleaseImageCase,    0, EGL_SUCCESS, 0, 0 },
   472         { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
   473         { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
   474         { ETerminateCase,       0, EGL_SUCCESS },
   475         { EFinishedCase },
   476         },
   477     },
   478     {
   479         TESTIDS("619"),
   480         CASETITLE("Functional: Negative: eglDestroyImageKHR can not be used for images acquired from endpoint."),
   481         SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
   482         {
   483         { EInitializeCase,      0, EGL_SUCCESS },
   484         { ECreateSurfaceCase,   0, EGL_SUCCESS, 0, EStandardSurface },
   485         { ECreateEndpointCase,  0, EGL_SUCCESS, },
   486         { EDrawContentCase,     0, EGL_SUCCESS, },
   487         { EContentUpdateCase,   0, EGL_SUCCESS, },
   488         { EBeginStreamingCase,  0, EGL_SUCCESS, },
   489         { EAcquireImageCase,    0, EGL_SUCCESS, },
   490         { EDestroyEglImageCase, EExpectError, EGL_BAD_ACCESS },
   491         // Compare Image to make sure it's still "there".
   492         { ECompareImageCase,    0, EGL_SUCCESS, },
   493         { EReleaseImageCase,    0, EGL_SUCCESS, },
   494         { EDestroyEndpointCase, 0, EGL_SUCCESS, },
   495         { ETerminateCase,       0, EGL_SUCCESS },
   496         { EFinishedCase },
   497         },
   498     },
   499 
   500 };
   501 
   502 
   503 static const TTestCases KTestCases[] =
   504 {
   505         TestCase(KAcquirePositiveCases),
   506         TestCase(KAcquireNegativeCases),
   507         TestCase(KAcquireBadParamCases),
   508         TestCase(KReleasePositiveCases),
   509         TestCase(KReleaseBadParamCases),
   510         TestCase(KReleaseNegativeCases),
   511 };
   512 
   513 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   514 
   515 
   516 CEglTest_LocalTestStep_EndpointAcquire::CEglTest_LocalTestStep_EndpointAcquire():
   517     CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   518     {
   519     }