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.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
sl@0
    13
sl@0
    14
/**
sl@0
    15
 @file
sl@0
    16
 @test
sl@0
    17
 @internalComponent - Internal Symbian test code
sl@0
    18
*/
sl@0
    19
sl@0
    20
#include "egltest_endpointstreaming.h"
sl@0
    21
sl@0
    22
sl@0
    23
/**
sl@0
    24
@SYMTestCaseID GRAPHICS-EGL-04xx
sl@0
    25
sl@0
    26
@SYMTestPriority 1
sl@0
    27
sl@0
    28
@SYMPREQ 2670
sl@0
    29
sl@0
    30
@SYMREQ
sl@0
    31
sl@0
    32
@SYMTestCaseDesc
sl@0
    33
Test the behaviour of eglEndpointBeginStreamingNOK and eglEndpointEndStreamingNOK with and
sl@0
    34
without bad parameters.
sl@0
    35
sl@0
    36
@SYMTestActions
sl@0
    37
Create a number of surfaces
sl@0
    38
For each test case in a loop
sl@0
    39
    *   start the test in the remote windows server side to create endpoints
sl@0
    40
    *   in the client side call a surface update on any surface which should have the ready
sl@0
    41
        attribute set
sl@0
    42
    *   Send commands with parameters to the windows server process test render stage to
sl@0
    43
        begin/end streaming on an end point. These parameters include any error codes which
sl@0
    44
        is expected.
sl@0
    45
    *   Log any failures
sl@0
    46
If the procedure was successful release all the resources and check the heap for memory leaks.
sl@0
    47
No memory or handle leaks.
sl@0
    48
sl@0
    49
@SYMTestExpectedResults
sl@0
    50
If the function fails, the return value is undefined and an error is generated.
sl@0
    51
If dpy is not the handle of a valid EGLDisplay object, the error EGL_BAD_DISPLAY is
sl@0
    52
generated for both BeginSreaming and EndStraming
sl@0
    53
If endpoint is not a valid EGLEndpointNOK object, the error EGL_BAD_ENDPOINT_NOK is
sl@0
    54
generated for both BeginStreaming and EndStraming.
sl@0
    55
If the endpoint is not ready,EGL_BAD_ACCESS is generated for calling BeginStreaming.
sl@0
    56
*/
sl@0
    57
sl@0
    58
sl@0
    59
static const TTestCase KStreamingPositiveCases[] =
sl@0
    60
{
sl@0
    61
    {
sl@0
    62
        TESTIDS("545A, 546A"),
sl@0
    63
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin and Endstreaming only"),
sl@0
    64
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    65
        {
sl@0
    66
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
    67
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
    68
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
    69
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
    70
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
    71
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
    72
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
    73
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
    74
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
    75
        { EFinishedCase }
sl@0
    76
        },
sl@0
    77
    },
sl@0
    78
    {
sl@0
    79
        TESTIDS("545B, 546B"),
sl@0
    80
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin, twice, then Endstreaming"),
sl@0
    81
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    82
        {
sl@0
    83
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
    84
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
    85
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
    86
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
    87
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
    88
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
    89
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
    90
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
    91
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
    92
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
    93
        { EFinishedCase }
sl@0
    94
        },
sl@0
    95
    },
sl@0
    96
    {
sl@0
    97
        TESTIDS("545C, 546C"),
sl@0
    98
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin then Endstreaming twice"),
sl@0
    99
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   100
        {
sl@0
   101
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   102
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   103
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   104
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   105
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   106
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   107
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   108
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   109
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   110
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   111
        { EFinishedCase }
sl@0
   112
        },
sl@0
   113
    },
sl@0
   114
    // Now check that we can and can't acquire images when in or out of a streaming block.
sl@0
   115
    {
sl@0
   116
        TESTIDS("545D, 546D"),
sl@0
   117
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, acquire, endstreaming"),
sl@0
   118
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   119
        {
sl@0
   120
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   121
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   122
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   123
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   124
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   125
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   126
        { EAcquireImageCase,    0,              EGL_SUCCESS },
sl@0
   127
        { ECompareImageCase,    0,              EGL_SUCCESS },
sl@0
   128
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   129
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   130
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   131
        { EFinishedCase }
sl@0
   132
        },
sl@0
   133
    },
sl@0
   134
    {
sl@0
   135
        TESTIDS("545E, 546E"),
sl@0
   136
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming, acquire"),
sl@0
   137
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   138
        {
sl@0
   139
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   140
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   141
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   142
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   143
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   144
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   145
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   146
        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
sl@0
   147
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   148
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   149
        { EFinishedCase }
sl@0
   150
        },
sl@0
   151
    },
sl@0
   152
    {
sl@0
   153
        TESTIDS("545F, 546F"),
sl@0
   154
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming twice, endstreaming, acquire"),
sl@0
   155
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   156
        {
sl@0
   157
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   158
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   159
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   160
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   161
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   162
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   163
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   164
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   165
        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
sl@0
   166
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   167
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   168
        { EFinishedCase }
sl@0
   169
        },
sl@0
   170
    },
sl@0
   171
    {
sl@0
   172
        TESTIDS("545G, 546G"),
sl@0
   173
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming twice, beginstreaming, acquire"),
sl@0
   174
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   175
        {
sl@0
   176
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   177
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   178
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   179
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   180
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   181
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   182
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   183
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   184
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   185
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   186
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   187
        { EAcquireImageCase,    0,              EGL_SUCCESS },
sl@0
   188
        { ECompareImageCase,    0,              EGL_SUCCESS },
sl@0
   189
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   190
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   191
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   192
        { EFinishedCase }
sl@0
   193
        },
sl@0
   194
    },
sl@0
   195
    {
sl@0
   196
        TESTIDS("545H, 546H"),
sl@0
   197
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (not ready)"),
sl@0
   198
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   199
        {
sl@0
   200
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   201
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   202
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   203
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   204
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   205
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   206
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   207
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   208
        // We should get bad access, as the endpoint is not ready!
sl@0
   209
        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
sl@0
   210
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   211
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   212
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   213
        { EFinishedCase }
sl@0
   214
        },
sl@0
   215
    },
sl@0
   216
    {
sl@0
   217
        TESTIDS("545I, 546I"),
sl@0
   218
        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (ready)"),
sl@0
   219
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   220
        {
sl@0
   221
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   222
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   223
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   224
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   225
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   226
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   227
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   228
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   229
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   230
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   231
        // We should get bad access, as the endpoint is not in a streaming block!
sl@0
   232
        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
sl@0
   233
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   234
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   235
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   236
        { EFinishedCase }
sl@0
   237
        },
sl@0
   238
    },
sl@0
   239
};
sl@0
   240
sl@0
   241
static const TTestCase KStreamingBadParameterCases[] =
sl@0
   242
{
sl@0
   243
    {
sl@0
   244
        TESTIDS("553A"),
sl@0
   245
        CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: Test eglEndpointBeginStreaming bad parameter variations"),
sl@0
   246
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   247
        {
sl@0
   248
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   249
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   250
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   251
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   252
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   253
        // Bad display on it's own.
sl@0
   254
        { EBeginStreamingCase,  EUseBadDisplay, EGL_BAD_DISPLAY },
sl@0
   255
        // Bad display should be priority over the bad endpoint
sl@0
   256
        { EBeginStreamingCase,  EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
sl@0
   257
        // Bad endpoint should result in "BAD_ENDPOINT" error.
sl@0
   258
        { EBeginStreamingCase,  EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
sl@0
   259
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   260
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   261
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   262
        { EFinishedCase }
sl@0
   263
        },
sl@0
   264
    },
sl@0
   265
    {
sl@0
   266
        TESTIDS("554A"),
sl@0
   267
        CASETITLE("Functional: Negative: eglEndpointEndStreamingNOK with Bad Parameters: Test eglEndpointEndStreaming bad parameter variations"),
sl@0
   268
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   269
        {
sl@0
   270
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   271
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   272
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   273
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   274
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   275
        // Bad display on it's own.
sl@0
   276
        { EEndStreamingCase,    EUseBadDisplay, EGL_BAD_DISPLAY },
sl@0
   277
        // Bad display should be priority over the bad endpoint
sl@0
   278
        { EEndStreamingCase,    EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
sl@0
   279
        { EEndStreamingCase,    EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
sl@0
   280
        { EEndStreamingCase,    0,              EGL_SUCCESS },
sl@0
   281
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   282
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   283
        { EFinishedCase }
sl@0
   284
        },
sl@0
   285
    },
sl@0
   286
};
sl@0
   287
sl@0
   288
static const TTestCase KStreamingNegativeCases[] =
sl@0
   289
{
sl@0
   290
    {
sl@0
   291
        TESTIDS("553B"),
sl@0
   292
        CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: eglEndpointBeginStreaming with no contentupdate"),
sl@0
   293
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   294
        {
sl@0
   295
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   296
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   297
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   298
        { EBeginStreamingCase,  EExpectError,   EGL_BAD_ACCESS },
sl@0
   299
        { EDrawContentCase,     0,              EGL_SUCCESS },
sl@0
   300
        { EContentUpdateCase,   0,              EGL_SUCCESS },
sl@0
   301
        { EBeginStreamingCase,  0,              EGL_SUCCESS },
sl@0
   302
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   303
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   304
        { EFinishedCase }
sl@0
   305
        },
sl@0
   306
    },
sl@0
   307
};
sl@0
   308
sl@0
   309
static const TTestCases KTestCases[] =
sl@0
   310
{
sl@0
   311
    TestCase(KStreamingPositiveCases),
sl@0
   312
    TestCase(KStreamingBadParameterCases),
sl@0
   313
    TestCase(KStreamingNegativeCases),
sl@0
   314
};
sl@0
   315
sl@0
   316
const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
sl@0
   317
sl@0
   318
CEglTest_LocalTestStep_EndpointStreaming::CEglTest_LocalTestStep_EndpointStreaming():
sl@0
   319
    CEgltest_Local_Engine(KTestCases, KNumberTestCases)
sl@0
   320
    {
sl@0
   321
    }