os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointstreaming_local.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 
    13 
    14 /**
    15  @file
    16  @test
    17  @internalComponent - Internal Symbian test code
    18 */
    19 
    20 #include "egltest_endpointstreaming.h"
    21 
    22 
    23 /**
    24 @SYMTestCaseID GRAPHICS-EGL-04xx
    25 
    26 @SYMTestPriority 1
    27 
    28 @SYMPREQ 2670
    29 
    30 @SYMREQ
    31 
    32 @SYMTestCaseDesc
    33 Test the behaviour of eglEndpointBeginStreamingNOK and eglEndpointEndStreamingNOK with and
    34 without bad parameters.
    35 
    36 @SYMTestActions
    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
    41         attribute set
    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
    44         is expected.
    45     *   Log any failures
    46 If the procedure was successful release all the resources and check the heap for memory leaks.
    47 No memory or handle leaks.
    48 
    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.
    56 */
    57 
    58 
    59 static const TTestCase KStreamingPositiveCases[] =
    60 {
    61     {
    62         TESTIDS("545A, 546A"),
    63         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin and Endstreaming only"),
    64         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    65         {
    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 },
    75         { EFinishedCase }
    76         },
    77     },
    78     {
    79         TESTIDS("545B, 546B"),
    80         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin, twice, then Endstreaming"),
    81         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    82         {
    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 },
    93         { EFinishedCase }
    94         },
    95     },
    96     {
    97         TESTIDS("545C, 546C"),
    98         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin then Endstreaming twice"),
    99         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   100         {
   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 },
   111         { EFinishedCase }
   112         },
   113     },
   114     // Now check that we can and can't acquire images when in or out of a streaming block.
   115     {
   116         TESTIDS("545D, 546D"),
   117         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, acquire, endstreaming"),
   118         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   119         {
   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 },
   131         { EFinishedCase }
   132         },
   133     },
   134     {
   135         TESTIDS("545E, 546E"),
   136         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming, acquire"),
   137         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   138         {
   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 },
   149         { EFinishedCase }
   150         },
   151     },
   152     {
   153         TESTIDS("545F, 546F"),
   154         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming twice, endstreaming, acquire"),
   155         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   156         {
   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 },
   168         { EFinishedCase }
   169         },
   170     },
   171     {
   172         TESTIDS("545G, 546G"),
   173         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming twice, beginstreaming, acquire"),
   174         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   175         {
   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 },
   192         { EFinishedCase }
   193         },
   194     },
   195     {
   196         TESTIDS("545H, 546H"),
   197         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (not ready)"),
   198         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   199         {
   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 },
   213         { EFinishedCase }
   214         },
   215     },
   216     {
   217         TESTIDS("545I, 546I"),
   218         CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (ready)"),
   219         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   220         {
   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 },
   236         { EFinishedCase }
   237         },
   238     },
   239 };
   240 
   241 static const TTestCase KStreamingBadParameterCases[] =
   242 {
   243     {
   244         TESTIDS("553A"),
   245         CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: Test eglEndpointBeginStreaming bad parameter variations"),
   246         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   247         {
   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 },
   262         { EFinishedCase }
   263         },
   264     },
   265     {
   266         TESTIDS("554A"),
   267         CASETITLE("Functional: Negative: eglEndpointEndStreamingNOK with Bad Parameters: Test eglEndpointEndStreaming bad parameter variations"),
   268         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   269         {
   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 },
   283         { EFinishedCase }
   284         },
   285     },
   286 };
   287 
   288 static const TTestCase KStreamingNegativeCases[] =
   289 {
   290     {
   291         TESTIDS("553B"),
   292         CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: eglEndpointBeginStreaming with no contentupdate"),
   293         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   294         {
   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 },
   304         { EFinishedCase }
   305         },
   306     },
   307 };
   308 
   309 static const TTestCases KTestCases[] =
   310 {
   311     TestCase(KStreamingPositiveCases),
   312     TestCase(KStreamingBadParameterCases),
   313     TestCase(KStreamingNegativeCases),
   314 };
   315 
   316 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   317 
   318 CEglTest_LocalTestStep_EndpointStreaming::CEglTest_LocalTestStep_EndpointStreaming():
   319     CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   320     {
   321     }