os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpoint_stresstests.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) 2010 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
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code
sl@0
    20
*/
sl@0
    21
sl@0
    22
#include "egltest_endpoint_stresstests.h"
sl@0
    23
#include "egltest_endpoint_engine.h"
sl@0
    24
sl@0
    25
sl@0
    26
// an example of table with "random order numbers 0..3". 
sl@0
    27
static const TInt KImageTable[] = { 1, 3, 0, 2, 3, 1, 2, 0 };
sl@0
    28
sl@0
    29
static TStressTestSection test588A[] =
sl@0
    30
{
sl@0
    31
    1, EOnErrorPolicyFail,
sl@0
    32
    { NO_PARAMS },
sl@0
    33
    {
sl@0
    34
        { EInitializeCase,           0,                EGL_SUCCESS },
sl@0
    35
        { EFinishedCase }
sl@0
    36
    },
sl@0
    37
    100, EOnErrorPolicyBreak,
sl@0
    38
    { PARAM_DECL_ITER(0, 100, 1) },
sl@0
    39
    {
sl@0
    40
        { ECreateSurfaceCase,        0,              EGL_SUCCESS, PARAM0(0), EStandardSurface },
sl@0
    41
        { EFinishedCase }
sl@0
    42
    },
sl@0
    43
    100, EOnErrorPolicyBreak,
sl@0
    44
    { PARAM_DECL_ITER(0, 100, 1), PARAM_DECL_TABLE(KImageTable) },
sl@0
    45
    {
sl@0
    46
        { ECreateEndpointCase,       0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    47
        { EDrawContentCase,          0,              EGL_SUCCESS, PARAM0(0), PARAM1(0) },
sl@0
    48
        { EContentUpdateCase,        0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    49
        { EBeginStreamingCase,       0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    50
        { EAcquireImageCase,         0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    51
        { ECompareImageCase,         0,              EGL_SUCCESS, PARAM0(0), PARAM1(0) },
sl@0
    52
        { EReleaseImageCase,         0,              EGL_SUCCESS, PARAM0(0), PARAM0(0) },
sl@0
    53
        { EDestroyEndpointCase,      0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    54
        { EFinishedCase }
sl@0
    55
    },
sl@0
    56
    1, EOnErrorPolicyFail,
sl@0
    57
    { NO_PARAMS },
sl@0
    58
    {
sl@0
    59
        { ETerminateCase,            0,              EGL_SUCCESS },
sl@0
    60
        { EFinishedCase }
sl@0
    61
    },
sl@0
    62
};
sl@0
    63
sl@0
    64
static TStressTestSection test588B[] =
sl@0
    65
{
sl@0
    66
    1, EOnErrorPolicyFail,
sl@0
    67
    { NO_PARAMS },
sl@0
    68
    {
sl@0
    69
        { EInitializeCase,           0,                EGL_SUCCESS },
sl@0
    70
        { EFinishedCase }
sl@0
    71
    },
sl@0
    72
    1000, EOnErrorPolicyBreak,
sl@0
    73
    { PARAM_DECL_ITER(0, 1000, 1) },
sl@0
    74
    {
sl@0
    75
        { ECreateSurfaceCase,        0,              EGL_SUCCESS, PARAM0(0), EStandardSurface },
sl@0
    76
        { ECreateEndpointCase,       0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    77
        { EDrawContentCase,          0,              EGL_SUCCESS, PARAM0(0), PARAM0(0) },
sl@0
    78
        { EContentUpdateCase,        0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    79
        { EBeginStreamingCase,       0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    80
        { EAcquireImageCase,         0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    81
        { EFinishedCase }
sl@0
    82
    },
sl@0
    83
    1000, EOnErrorPolicyBreak,
sl@0
    84
    { PARAM_DECL_ITER(0, 1000, 1) },
sl@0
    85
    {
sl@0
    86
        { EReleaseImageCase,         0,              EGL_SUCCESS, PARAM0(0), PARAM0(0) },
sl@0
    87
        { EDestroyEndpointCase,      0,              EGL_SUCCESS, PARAM0(0) },
sl@0
    88
        { EFinishedCase }
sl@0
    89
    },
sl@0
    90
    1, EOnErrorPolicyFail,
sl@0
    91
    { NO_PARAMS },
sl@0
    92
    {
sl@0
    93
        { ETerminateCase,            0,              EGL_SUCCESS },
sl@0
    94
        { EFinishedCase }
sl@0
    95
    },
sl@0
    96
};
sl@0
    97
sl@0
    98
static TStressTestSection test589[] =
sl@0
    99
{
sl@0
   100
    1, EOnErrorPolicyFail,
sl@0
   101
    { NO_PARAMS },
sl@0
   102
    {
sl@0
   103
        { EInitializeCase,           0,              EGL_SUCCESS },
sl@0
   104
        { ECreateSurfaceCase,        0,              EGL_SUCCESS, 0, ELargestPossibleSurface },
sl@0
   105
        { ECreateEndpointCase,       0,              EGL_SUCCESS, 0 },
sl@0
   106
        { EFinishedCase }
sl@0
   107
    },
sl@0
   108
    5, EOnErrorPolicyBreak,
sl@0
   109
    { PARAM_DECL_ITER(0, 4, 1) },
sl@0
   110
    {
sl@0
   111
        { EDrawContentCase,          0,              EGL_SUCCESS, 0, PARAM0(0) },
sl@0
   112
        { EContentUpdateCase,        0,              EGL_SUCCESS, 0 },
sl@0
   113
        { EBeginStreamingCase,       0,              EGL_SUCCESS, 0 },
sl@0
   114
        { EAcquireImageCase,         0,              EGL_SUCCESS, 0 },
sl@0
   115
        { ECompareImageCase,         0,              EGL_SUCCESS, 0, PARAM0(0) },
sl@0
   116
        { EReleaseImageCase,         0,              EGL_SUCCESS, 0 },
sl@0
   117
        { EFinishedCase }
sl@0
   118
    },
sl@0
   119
    1, EOnErrorPolicyFail,
sl@0
   120
    { NO_PARAMS },
sl@0
   121
    {
sl@0
   122
        { EDestroyEndpointCase,      0,              EGL_SUCCESS, 0 },
sl@0
   123
        { EDestroySurfaceCase,       0,              EGL_SUCCESS, 0 },
sl@0
   124
        { ETerminateCase,            0,              EGL_SUCCESS },
sl@0
   125
        { EFinishedCase }
sl@0
   126
    },
sl@0
   127
};
sl@0
   128
sl@0
   129
static TStressTestSection test590A[] =
sl@0
   130
{
sl@0
   131
    1, EOnErrorPolicyFail,
sl@0
   132
    { NO_PARAMS },
sl@0
   133
    {
sl@0
   134
        { EInitializeCase,          0,          EGL_SUCCESS },
sl@0
   135
        { ECreateSurfaceCase,       0,          EGL_SUCCESS, 0, EStandardSurface },
sl@0
   136
        { ECreateEndpointCase,      0,          EGL_SUCCESS, 0 },
sl@0
   137
        { EFinishedCase }
sl@0
   138
    },
sl@0
   139
    1000, EOnErrorPolicyBreak,
sl@0
   140
    { PARAM_DECL_TABLE(KImageTable) },
sl@0
   141
    {
sl@0
   142
        { EDrawContentCase,         0,         EGL_SUCCESS, 0, PARAM0(0)},
sl@0
   143
        { EContentUpdateCase,       0,         EGL_SUCCESS, 0 },
sl@0
   144
        { EBeginStreamingCase,      0,         EGL_SUCCESS, 0 },
sl@0
   145
        { EAcquireImageCase,        0,         EGL_SUCCESS, 0 },
sl@0
   146
        { ECompareImageCase,        0,         EGL_SUCCESS, 0, PARAM0(0) },
sl@0
   147
        { EReleaseImageCase,        0,         EGL_SUCCESS, 0 },
sl@0
   148
        { EFinishedCase }
sl@0
   149
    },
sl@0
   150
    1, EOnErrorPolicyFail,
sl@0
   151
    { NO_PARAMS },
sl@0
   152
    {
sl@0
   153
        { EDestroyEndpointCase,     0,          EGL_SUCCESS, 0 },
sl@0
   154
        { ETerminateCase,           0,          EGL_SUCCESS },
sl@0
   155
        { EFinishedCase }
sl@0
   156
    },
sl@0
   157
};
sl@0
   158
sl@0
   159
static TStressTestSection test590B[] =
sl@0
   160
{
sl@0
   161
    1, EOnErrorPolicyFail,
sl@0
   162
    { NO_PARAMS },
sl@0
   163
    {
sl@0
   164
        { EInitializeCase,          0,          EGL_SUCCESS },
sl@0
   165
        { EFinishedCase }
sl@0
   166
    },
sl@0
   167
    260, EOnErrorPolicyBreak,
sl@0
   168
    {PARAM_DECL_ITER(0, 260, 1), PARAM_DECL_TABLE(KImageTable)},
sl@0
   169
    {
sl@0
   170
        { ECreateSurfaceCase,       0,          EGL_SUCCESS, PARAM0(0), EStandardSurface },
sl@0
   171
        { ECreateEndpointCase,      0,          EGL_SUCCESS, PARAM0(0) },
sl@0
   172
        { EDrawContentCase,         0,          EGL_SUCCESS, PARAM0(0), PARAM1(0)},
sl@0
   173
        { EContentUpdateCase,       0,          EGL_SUCCESS, PARAM0(0) },
sl@0
   174
        { EBeginStreamingCase,      0,          EGL_SUCCESS, PARAM0(0) },
sl@0
   175
        { EAcquireImageCase,        0,          EGL_SUCCESS, PARAM0(0) },
sl@0
   176
        { ECompareImageCase,        0,          EGL_SUCCESS, PARAM0(0), PARAM1(0)},
sl@0
   177
        { EFinishedCase }
sl@0
   178
    },
sl@0
   179
    260, EOnErrorPolicyBreak,
sl@0
   180
    {PARAM_DECL_ITER(0, 260, 1)},
sl@0
   181
    {
sl@0
   182
        { EReleaseImageCase,        0,          EGL_SUCCESS, PARAM0(0), PARAM0(0) },
sl@0
   183
        { EDestroyEndpointCase,     0,          EGL_SUCCESS, PARAM0(0) },
sl@0
   184
        { EFinishedCase }
sl@0
   185
    },
sl@0
   186
    1, EOnErrorPolicyFail,
sl@0
   187
    { NO_PARAMS },
sl@0
   188
    {
sl@0
   189
        { ETerminateCase,           0,          EGL_SUCCESS },
sl@0
   190
        { EFinishedCase }
sl@0
   191
    },
sl@0
   192
};
sl@0
   193
sl@0
   194
static TStressTestSection test592A[] =
sl@0
   195
{
sl@0
   196
    1, EOnErrorPolicyFail,
sl@0
   197
    { NO_PARAMS },
sl@0
   198
    {
sl@0
   199
        { EInitializeCase,          0,          EGL_SUCCESS },
sl@0
   200
        { ECreateSurfaceCase,       0,          EGL_SUCCESS, 0, EStandardSurface },
sl@0
   201
        { EFinishedCase }
sl@0
   202
    },
sl@0
   203
    1000, EOnErrorPolicyBreak,
sl@0
   204
    { PARAM_DECL_TABLE(KImageTable) },
sl@0
   205
    {
sl@0
   206
        { ECreateEndpointCase,      0,          EGL_SUCCESS, 0 },
sl@0
   207
        { EDrawContentCase,         0,          EGL_SUCCESS, 0, PARAM0(0)},
sl@0
   208
        { EContentUpdateCase,       0,          EGL_SUCCESS, 0 },
sl@0
   209
        { EBeginStreamingCase,      0,          EGL_SUCCESS, 0 },
sl@0
   210
        { EAcquireImageCase,        0,          EGL_SUCCESS, 0 },
sl@0
   211
        { ECompareImageCase,        0,          EGL_SUCCESS, 0, PARAM0(0)},
sl@0
   212
        { EReleaseImageCase,        0,          EGL_SUCCESS, 0 },
sl@0
   213
        { EDestroyEndpointCase,     0,          EGL_SUCCESS, 0 },
sl@0
   214
        { EFinishedCase }
sl@0
   215
    },
sl@0
   216
    1, EOnErrorPolicyFail,
sl@0
   217
    { NO_PARAMS },
sl@0
   218
    {
sl@0
   219
        { ETerminateCase,           0,          EGL_SUCCESS },
sl@0
   220
        { EFinishedCase }
sl@0
   221
    },
sl@0
   222
};
sl@0
   223
sl@0
   224
static TStressTestSection test592B[] =
sl@0
   225
{
sl@0
   226
    1, EOnErrorPolicyFail,
sl@0
   227
    { NO_PARAMS },
sl@0
   228
    {
sl@0
   229
        { EInitializeCase,          0,          EGL_SUCCESS },
sl@0
   230
        { EFinishedCase }
sl@0
   231
    },
sl@0
   232
    1000, EOnErrorPolicyBreak,
sl@0
   233
    { PARAM_DECL_TABLE(KImageTable) },
sl@0
   234
    {
sl@0
   235
        { ECreateSurfaceCase,       0,          EGL_SUCCESS, 0, EStandardSurface },
sl@0
   236
        { ECreateEndpointCase,      0,          EGL_SUCCESS, 0 },
sl@0
   237
        { EDrawContentCase,         0,          EGL_SUCCESS, 0, PARAM0(0)},
sl@0
   238
        { EContentUpdateCase,       0,          EGL_SUCCESS, 0 },
sl@0
   239
        { EBeginStreamingCase,      0,          EGL_SUCCESS, 0 },
sl@0
   240
        { EAcquireImageCase,        0,          EGL_SUCCESS, 0 },
sl@0
   241
        { ECompareImageCase,        0,          EGL_SUCCESS, 0, PARAM0(0) },
sl@0
   242
        { EReleaseImageCase,        0,          EGL_SUCCESS, 0 },
sl@0
   243
        { EDestroyEndpointCase,     0,          EGL_SUCCESS, 0 },
sl@0
   244
        { EDestroySurfaceCase,      0,          EGL_SUCCESS, 0 },
sl@0
   245
        { EFinishedCase }
sl@0
   246
    },
sl@0
   247
    1,  EOnErrorPolicyFail,
sl@0
   248
    { NO_PARAMS },
sl@0
   249
    {
sl@0
   250
        { ETerminateCase,           0,          EGL_SUCCESS },
sl@0
   251
        { EFinishedCase }
sl@0
   252
    },
sl@0
   253
};
sl@0
   254
static const TStressTestTable testTable[] =
sl@0
   255
{
sl@0
   256
#if 0
sl@0
   257
    {
sl@0
   258
        {
sl@0
   259
        TESTIDS("588A"),
sl@0
   260
        CASETITLE("Functional: Stress: Test 100 surfaces."),
sl@0
   261
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   262
        },
sl@0
   263
        TESTTABLE(test588A)
sl@0
   264
    },
sl@0
   265
    {
sl@0
   266
        {
sl@0
   267
        TESTIDS("588B"),
sl@0
   268
        CASETITLE("Functional: Stress: Test 1000 surfaces, destroy after."),
sl@0
   269
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   270
        },
sl@0
   271
        TESTTABLE(test588B)
sl@0
   272
    },
sl@0
   273
    {
sl@0
   274
        {
sl@0
   275
        TESTIDS("589"),
sl@0
   276
        CASETITLE("Functional: Stress: Test with largest possible surface"),
sl@0
   277
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   278
        },
sl@0
   279
        TESTTABLE(test589)
sl@0
   280
    }, 
sl@0
   281
#endif
sl@0
   282
    {
sl@0
   283
        {
sl@0
   284
        TESTIDS("590A"),
sl@0
   285
        CASETITLE("Functional: Stress: Test with 1000 surface updates"),
sl@0
   286
        SurfaceTypes3(ESurfTypeEglWindow, ESurfTypeRaw, ESurfTypeRawSingleBuffered),
sl@0
   287
        },
sl@0
   288
        TESTTABLE(test590A) 
sl@0
   289
    },
sl@0
   290
#if 0
sl@0
   291
    {
sl@0
   292
        {
sl@0
   293
        TESTIDS("590B"),
sl@0
   294
        CASETITLE("Functional: Stress: Test with 260 surfaces"),
sl@0
   295
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   296
        },
sl@0
   297
        TESTTABLE(test590B)
sl@0
   298
    },
sl@0
   299
    {
sl@0
   300
        {
sl@0
   301
        TESTIDS("592A"),
sl@0
   302
        CASETITLE("Functional: Stress: Large number of endpoint creation/destruction"),
sl@0
   303
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   304
        },
sl@0
   305
        TESTTABLE(test592A) 
sl@0
   306
    },   
sl@0
   307
    {
sl@0
   308
        {
sl@0
   309
        TESTIDS("592B"),
sl@0
   310
        CASETITLE("Functional: Stress: Large number of endpoint creation/destruction"),
sl@0
   311
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   312
        },
sl@0
   313
        TESTTABLE(test592B)       
sl@0
   314
    },
sl@0
   315
#endif
sl@0
   316
};
sl@0
   317
sl@0
   318
sl@0
   319
CEglTest_TestStep_StressTests::CEglTest_TestStep_StressTests()
sl@0
   320
    {
sl@0
   321
    }
sl@0
   322
sl@0
   323
CEglTest_TestStep_StressTests* CEglTest_TestStep_StressTests::New()
sl@0
   324
    {
sl@0
   325
    CEglTest_TestStep_StressTests *self = new CEglTest_TestStep_StressTests;
sl@0
   326
    
sl@0
   327
    if (self)
sl@0
   328
        {
sl@0
   329
        self->ConstructL(testTable, sizeof(testTable)/sizeof(testTable[0]));
sl@0
   330
        }
sl@0
   331
    return self;
sl@0
   332
    }
sl@0
   333
sl@0
   334
sl@0
   335
sl@0
   336
sl@0
   337