os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointdirtyarea.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Testing of eglEndpointDirtyAreaNOK functionality.
    15 //
    16 
    17 /**
    18  @file
    19  @test
    20  @internalComponent - Internal Symbian test code
    21 */
    22 
    23 #include "egltest_endpointdirtyarea.h"
    24 
    25 static const TTestCase KDirtyAreaPositiveCases[] =
    26 {
    27     {
    28         TESTIDS("614"),
    29         CASETITLE("Functional: Positive: eglGetEndpointDirtyArea basic test."),
    30         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    31         {
    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 },
    43         { EFinishedCase }
    44         },
    45     },
    46     {
    47         TESTIDS("615"),
    48         CASETITLE("Functional: Positive: eglGetEndpointDirtyArea simple working test - collapse area."),
    49         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    50         {
    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 },
    62         { EFinishedCase }
    63         },
    64     },
    65     {
    66         TESTIDS("617"),
    67         CASETITLE("Functional: Positive: eglGetEndpointDirtyArea - check number of rects avialable"),
    68         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    69         {
    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 },
    81         { EFinishedCase }
    82         },
    83     },
    84 };
    85 static const TTestCase KDirtyAreaNegativeCases[] =
    86 {
    87     {
    88         TESTIDS("616"),
    89         CASETITLE("Functional: Negative: eglRequestNotification bad parameter test."),
    90         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    91         {
    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 },
    99         // Bad display
   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 },
   110         { EFinishedCase }
   111         },
   112     },
   113     {
   114         TESTIDS("618"),
   115         CASETITLE("Functional: Negative: eglRequestNotification no acquired image."),
   116         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   117         {
   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 },
   128         { EFinishedCase }
   129         },
   130     },
   131 
   132 };
   133 
   134 
   135 static const TTestCases KTestCases[] =
   136 {
   137         TestCase(KDirtyAreaPositiveCases),
   138         TestCase(KDirtyAreaNegativeCases),
   139 };
   140 
   141 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   142 
   143 CEglTest_LocalTestStep_EndpointDirtyArea::CEglTest_LocalTestStep_EndpointDirtyArea():
   144     CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   145     {
   146     }