os/graphics/egl/egltest/src/eglteststep.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-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
*/
sl@0
    20
#include "eglteststep.h"
sl@0
    21
sl@0
    22
#include "egltest_general.h"
sl@0
    23
#include "egltest_geterroranddisplay.h"
sl@0
    24
#include "egltest_syncobject.h"
sl@0
    25
#include "egltest_nativepixmaptype.h"
sl@0
    26
#include "egltest_createpixmapsurface.h"
sl@0
    27
#include "egltest_image.h"
sl@0
    28
#include "egltest_sibling.h"
sl@0
    29
#include "egltest_image_negative.h"
sl@0
    30
#include "egltest_vgimagetosurfaces.h"
sl@0
    31
#include "egltest_image_multithread.h"
sl@0
    32
#include "egltest_image_multiprocess.h"
sl@0
    33
#include "egltest_benchmark_sgimage.h"
sl@0
    34
#include "egltest_oom_sgimage.h"
sl@0
    35
#include "egltest_stress_sgimage.h"
sl@0
    36
#include "egltest_benchmark_swapbuffers.h"
sl@0
    37
#include "egltest_surfacescaling.h"
sl@0
    38
sl@0
    39
/*
sl@0
    40
Entry point from egltest to create test step
sl@0
    41
*/
sl@0
    42
EXPORT_C CEglTestStep* EglTestStepFactory::GetEglTestStep(const TDesC& aStepName)
sl@0
    43
// static
sl@0
    44
	{
sl@0
    45
	CEglTestStep* testStep = NULL;
sl@0
    46
sl@0
    47
	// General tests
sl@0
    48
	if (aStepName == KDumpStrings)																	testStep = new CEglTest_DumpStrings;
sl@0
    49
	else if (aStepName == KQueryString_Extensions)													testStep = new CEglTest_QueryString_Extensions;
sl@0
    50
    else if (aStepName == KEglTerminate_Negative)                                                   testStep = new CEglTest_EglTerminate_Negative;
sl@0
    51
    else if (aStepName == KGeneral_Negative_ProcAddress)                                            testStep = new CEglTest_General_Negative_ProcAddress;
sl@0
    52
sl@0
    53
    // GetError and Display tests
sl@0
    54
    else if (aStepName == KGetError)                                                                testStep = new CEglTest_GetError;
sl@0
    55
    else if (aStepName == KGetErrorMultiThread)                                                     testStep = new CEglTest_GetErrorMultiThread;
sl@0
    56
    else if (aStepName == KDisplay_Positive_Basic)                                                  testStep = new CEglTest_Display_Positive_Basic;
sl@0
    57
    else if (aStepName == KDisplay_Negative_InvalidDisplay)                                         testStep = new CEglTest_Display_Negative_InvalidDisplay;
sl@0
    58
    else if (aStepName == KDisplay_Negative_NotInitializedDisplay)                                  testStep = new CEglTest_Display_Negative_NotInitializedDisplay;   
sl@0
    59
    else if (aStepName == KDisplay_Positive_ReinitializeDisplay)                                    testStep = new CEglTest_Display_Positive_ReinitializeDisplay;
sl@0
    60
    else if (aStepName == KDisplay_Positive_MultipleInitialization)                                 testStep = new CEglTest_Display_Positive_MultipleInitialization;
sl@0
    61
    else if (aStepName == KDisplay_Positive_MultipleTermination)                                    testStep = new CEglTest_Display_Positive_MultipleTermination;
sl@0
    62
    else if (aStepName == KDisplay_Positive_Multithread_Basic)                                      testStep = new CEglTest_Display_Positive_Multithread_Basic;
sl@0
    63
    else if (aStepName == KDisplay_Positive_Multithread_InitTerminateInOneTread)                    testStep = new CEglTest_Display_Positive_Multithread_InitTerminateInOneTread;
sl@0
    64
    else if (aStepName == KDisplay_Positive_Multithread_InitTerminateFromDifferentThread)           testStep = new CEglTest_Display_Positive_Multithread_InitTerminateFromDifferentThread;
sl@0
    65
    else if (aStepName == KDisplay_Positive_Multithread_Stress)                                     testStep = new CEglTest_Display_Positive_Multithread_Stress;
sl@0
    66
    else if (aStepName == KDisplay_Positive_Multiprocess_Basic)                                     testStep = new CEglTest_Display_Positive_Multiprocess_Basic;
sl@0
    67
    else if (aStepName == KDisplay_OOM_ClientHeap)                                                  testStep = new CEglTest_Display_OOM_ClientHeap;
sl@0
    68
    else if (aStepName == KDisplay_OOM_ClientHeap_Initialize)                                       testStep = new CEglTest_Display_OOM_ClientHeap_Initialize;
sl@0
    69
sl@0
    70
	// SyncObject tests excluding WaitFlush which requires OpenVG and OpenGL ES
sl@0
    71
	else if (aStepName == KSyncObject_Positive_GetProcAddress)										testStep = new CEglTest_SyncObject_Positive_GetProcAddress;
sl@0
    72
	else if (aStepName == KSyncObject_Positive_CreateDestroy)										testStep = new CEglTest_SyncObject_Positive_CreateDestroy;
sl@0
    73
	else if (aStepName == KSyncObject_Positive_WaitSignal)											testStep = new CEglTest_SyncObject_Positive_WaitSignal;
sl@0
    74
	else if (aStepName == KSyncObject_Positive_WaitSignal2)											testStep = new CEglTest_SyncObject_Positive_WaitSignal2;
sl@0
    75
	else if (aStepName == KSyncObject_Positive_WaitDelete)											testStep = new CEglTest_SyncObject_Positive_WaitDelete;
sl@0
    76
	else if (aStepName == KSyncObject_Positive_WaitWithTimeoutExpired)								testStep = new CEglTest_SyncObject_Positive_WaitWithTimeoutExpired;
sl@0
    77
	else if (aStepName == KSyncObject_Positive_SignalBeforeTimeoutExpired)							testStep = new CEglTest_SyncObject_Positive_SignalBeforeTimeoutExpired;
sl@0
    78
	else if (aStepName == KSyncObject_Positive_DeleteBeforeTimeoutExpired)							testStep = new CEglTest_SyncObject_Positive_DeleteBeforeTimeoutExpired;
sl@0
    79
	else if (aStepName == KSyncObject_Positive_Multithread_SignalBeforeTimeout)						testStep = new CEglTest_SyncObject_Positive_Multithread_SignalBeforeTimeout;
sl@0
    80
	else if (aStepName == KSyncObject_Positive_Multithread_SignalAfterTimeout)						testStep = new CEglTest_SyncObject_Positive_Multithread_SignalAfterTimeout;
sl@0
    81
	else if (aStepName == KSyncObject_Positive_Multithread_WaitOnTwoSyncObject)						testStep = new CEglTest_SyncObject_Positive_Multithread_WaitOnTwoSyncObject;
sl@0
    82
	else if (aStepName == KSyncObject_Positive_Wait_TestMode)										testStep = new CEglTest_SyncObject_Positive_Wait_TestMode;
sl@0
    83
	else if (aStepName == KSyncObject_Positive_Multithread_Deletion)								testStep = new CEglTest_SyncObject_Positive_Multithread_Deletion;
sl@0
    84
	else if (aStepName == KSyncObject_Positive_Terminate)                                           testStep = new CEglTest_SyncObject_Positive_Terminate;
sl@0
    85
	else if (aStepName == KSyncObject_Positive_TerminateBeforeTimeoutExpired)                       testStep = new CEglTest_SyncObject_Positive_TerminateBeforeTimeoutExpired; 
sl@0
    86
	else if (aStepName == KSyncObject_Positive_Stress)												testStep = new CEglTest_SyncObject_Positive_Stress;
sl@0
    87
	else if (aStepName == KSyncObject_Negative_WrongParameters)										testStep = new CEglTest_SyncObject_Negative_WrongParameters;
sl@0
    88
	else if (aStepName == KSyncObject_Negative_SignalImpl)											testStep = new CEglTest_SyncObject_Negative_SignalImpl;
sl@0
    89
	else if (aStepName == KSyncObject_Negative_OOM)													testStep = new CEglTest_SyncObject_Negative_OOM;
sl@0
    90
	// SyncObjecte WaitFlush test is implementation specific as it uses OpenVG and OpenGL ES
sl@0
    91
	else if (aStepName == KSyncObject_Positive_WaitFlush)                                           testStep = new CEglTest_SyncObject_Positive_WaitFlush;
sl@0
    92
sl@0
    93
	// NativePixmapType tests
sl@0
    94
	else if (aStepName == KNativePixmapType_SingleThread_Positive_RSgImage)							testStep = new CEglTest_NativePixmapType_SingleThread_Positive_RSgImage;	
sl@0
    95
	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitTwice)				testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitTwice;
sl@0
    96
	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitTwice_NoRendezvous)	testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitTwice_NoRendezvous;
sl@0
    97
	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitOneThreadOnly)		testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitOneThreadOnly;	
sl@0
    98
	else if (aStepName == KNativePixmapType_MultiProcess_Both_RSgImage)								testStep = new CEglTest_NativePixmapType_MultiProcess_Both_RSgImage;
sl@0
    99
	else if (aStepName == KChooseConfig_EGL_MATCH_NATIVE_PIXMAP_KHR)								testStep = new CEglTest_ChooseConfig_EGL_MATCH_NATIVE_PIXMAP_KHR;
sl@0
   100
	else if (aStepName == KCFbsBitmap_EGL_MATCH_NATIVE_PIXMAP_KHR)									testStep = new CEglTest_CFbsBitmap_EGL_MATCH_NATIVE_PIXMAP_KHR;
sl@0
   101
sl@0
   102
	// CreatePixmapSurface tests
sl@0
   103
	else if (aStepName == KCreatePixmapSurface_RSgImage_Negative_RSgImage_NotInitialised)			testStep = new CEglTest_CreatePixmapSurface_RSgImage_Negative_RSgImage_NotInitialised;
sl@0
   104
	else if (aStepName == KCreatePixmapSurface_Negative_Invalid_Pixmap_Type)						testStep = new CEglTest_CreatePixmapSurface_Negative_Invalid_Pixmap_Type;
sl@0
   105
	else if (aStepName == KCreatePixmapSurface_Alpha_bit_RSgImage)									testStep = new CEglTest_CreatePixmapSurface_Alpha_bit_RSgImage;
sl@0
   106
    else if (aStepName == KCreatePixmapSurface_RSgImage_Positive_MantadoryFormatUsageSupport)       testStep = new CEglTest_CreatePixmapSurface_RSgImage_Positive_MantadoryFormatUsageSupport;
sl@0
   107
sl@0
   108
	// Image tests
sl@0
   109
	else if (aStepName == KEGL_Image_SgDriverHandle)												testStep = new CEglTest_EGL_Image_SgDriverHandle;
sl@0
   110
	else if (aStepName == KEGL_Image_RSgImage_UseOpenVG_PersistImageData)							testStep = new CEglTest_EGL_Image_RSgImage_UseOpenVG_PersistImageData;
sl@0
   111
	else if (aStepName == KEGL_Image_Consistent_Linked_List)										testStep = new CEglTest_EGL_Image_Consistent_Linked_List;	
sl@0
   112
sl@0
   113
	// Image negative tests
sl@0
   114
	else if (aStepName == KEGL_Image_eglCreateImage_Bad_Parameter)									testStep = new CEglTest_EGL_Image_eglCreateImage_Bad_Parameter;
sl@0
   115
	else if (aStepName == KEGL_Image_UsageBits_Enforcement)											testStep = new CEglTest_EGL_Image_UsageBits_Enforcement;
sl@0
   116
	else if (aStepName == KEGL_Image_DestroyImageKHR)												testStep = new CEglTest_EGL_Image_DestroyImageKHR;	
sl@0
   117
	else if (aStepName == KEGL_Image_VGImage_From_Invalid_EGLHandle)								testStep = new CEglTest_EGL_Image_VGImage_From_Invalid_EGLHandle;
sl@0
   118
	else if (aStepName == KEGL_Image_Self_Drawing)													testStep = new CEglTest_EGL_Image_Self_Drawing;
sl@0
   119
sl@0
   120
	// Siblings tests
sl@0
   121
	else if (aStepName == KEGL_Image_Sibling_Basic)													testStep = new CEglTest_EGL_Image_Sibling_Basic;
sl@0
   122
	else if (aStepName == KEGL_Image_Sibling_VGImage)												testStep = new CEglTest_EGL_Image_Sibling_VGImage;
sl@0
   123
	else if (aStepName == KEGL_Image_Sibling_Two_VGImages)											testStep = new CEglTest_EGL_Image_Sibling_Two_VGImages;
sl@0
   124
	else if (aStepName == KEGL_Image_Sibling_VGImage_Child)											testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child;
sl@0
   125
	else if (aStepName == KEGL_Image_Sibling_VGImage_Child_CheckContents)							testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child_CheckContents;
sl@0
   126
	else if (aStepName == KEGL_Image_Sibling_VGImage_Child_CheckContents_CloseSgEarlier)			testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child_CheckContents_CloseSgEarlier;
sl@0
   127
	else if (aStepName == KEGL_Image_CreatePBufferFromClient_With_Sibling_VGImage)					testStep = new CEglTest_EGL_Image_CreatePBufferFromClient_With_Sibling_VGImage;
sl@0
   128
sl@0
   129
	// VgImage to surfaces tests
sl@0
   130
	else if (aStepName == KEGL_Image_VgImage_To_Pixmap)												testStep = new CEglTest_EGL_Image_VgImage_To_Pixmap;
sl@0
   131
	else if (aStepName == KEGL_Image_VGImage_To_Pixmap_CFbs)										testStep = new CEglTest_EGL_Image_VGImage_To_Pixmap_CFbs;
sl@0
   132
	else if (aStepName == KEGL_Image_VgImage_To_pBuffer)											testStep = new CEglTest_EGL_Image_VgImage_To_pBuffer;
sl@0
   133
	else if (aStepName == KEGL_Image_VgImage_To_Window)												testStep = new CEglTest_EGL_Image_VgImage_To_Window;
sl@0
   134
sl@0
   135
	//MultiThreaded
sl@0
   136
	else if (aStepName == KEGL_Image_Multi_Thread_Parallel)											testStep = new CEglTest_EGL_Image_Multi_Thread_Parallel;
sl@0
   137
	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_Basic)									testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_Basic;
sl@0
   138
	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_VGImage)									testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_VGImage;
sl@0
   139
	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_VGImage_PassingEGLImage)					testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_VGImage_PassingEGLImage;
sl@0
   140
	else if (aStepName == KEGL_Image_Multi_Thread_Exit_Thread)										testStep = new CEglTest_EGL_Image_Multi_Thread_Exit_Thread;
sl@0
   141
	else if (aStepName == KEGL_Image_Multi_Thread_DrawAfterTerminate)								testStep = new CEglTest_EGL_Image_Multi_Thread_DrawAfterTerminate;
sl@0
   142
	
sl@0
   143
    //MultiProcess
sl@0
   144
	else if (aStepName == KEGL_Image_Multi_Process_Parallel)										testStep = new CEglTest_EGL_Image_Multi_Process_Parallel;
sl@0
   145
	else if (aStepName == KEGL_Image_Multi_Process_Sibling_Basic)									testStep = new CEglTest_EGL_Image_Multi_Process_Sibling_Basic;
sl@0
   146
	else if (aStepName == KEGL_Image_Multi_Process_Sibling_CheckContents)							testStep = new CEglTest_EGL_Image_Multi_Process_Sibling_CheckContents;
sl@0
   147
	else if (aStepName == KEGL_Image_Multi_Process_VgImage_Source)									testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_Source;
sl@0
   148
	else if (aStepName == KEGL_Image_Multi_Process_VgImage_DrawAfterTerminate)						testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_DrawAfterTerminate;
sl@0
   149
	else if (aStepName == KEGL_Image_Multi_Process_FontServer_Upfront)								testStep = new CEglTest_EGL_Image_Multi_Process_FontServer_Upfront;
sl@0
   150
	else if (aStepName == KEGL_Image_Multi_Process_FontServer_Deferred)								testStep = new CEglTest_EGL_Image_Multi_Process_FontServer_Deferred;
sl@0
   151
	else if (aStepName == KEGL_Image_Multi_Process_ThemeServer)										testStep = new CEglTest_EGL_Image_Multi_Process_ThemeServer;
sl@0
   152
	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ProcessTerminate)						testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ProcessTerminate;
sl@0
   153
	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ProcessTerminateNegative)				testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ProcessTerminateNegative;
sl@0
   154
	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ReadWrite)								testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ReadWrite;
sl@0
   155
sl@0
   156
	// Benchmark - SgImage
sl@0
   157
    else if (aStepName == KBenchmark_CreateCloseImage)                                              testStep = new CEglTest_Benchmark_CreateCloseImage;
sl@0
   158
    else if (aStepName == KBenchmark_Multi_Process_CreateCloseImage)                                testStep = new CEglTest_Benchmark_Multi_Process_CreateCloseImage;
sl@0
   159
    else if (aStepName == KBenchmark_DrawImage)                                                     testStep = new CEglTest_Benchmark_DrawImage;
sl@0
   160
sl@0
   161
	// Benchmark - SwapBuffers
sl@0
   162
    else if (aStepName == KBenchmark_SwapBuffers)                                                   testStep = new CEglTest_Benchmark_SwapBuffers;
sl@0
   163
sl@0
   164
	//OOM - SgImage
sl@0
   165
    else if (aStepName == KOOM_CloseVGImageWithTermination)                                         testStep = new CEglTest_OOM_CloseVGImageWithTermination;
sl@0
   166
    else if (aStepName == KOOM_CloseVGImage)                                                        testStep = new CEglTest_OOM_CloseVGImage;
sl@0
   167
    else if (aStepName == KOOM_ClosePixmapSurfaceWithTermination)                                   testStep = new CEglTest_OOM_ClosePixmapSurfaceWithTermination;
sl@0
   168
    else if (aStepName == KOOM_ClosePixmapSurface)                                                  testStep = new CEglTest_OOM_ClosePixmapSurface; 
sl@0
   169
    else if (aStepName == KOOM_CloseSgImageDifferentProcess)                                        testStep = new CEglTest_OOM_CloseSgImageDifferentProcess; 
sl@0
   170
    else if (aStepName == KOOM_CloseSgImageSameThread)                                              testStep = new CEglTest_OOM_CloseSgImageSameThread; 
sl@0
   171
sl@0
   172
    //Stress - SgImage
sl@0
   173
    else if (aStepName == KStress)                                                                  testStep = new CEglTest_Stress;
sl@0
   174
sl@0
   175
    // Surface Scaling
sl@0
   176
    else if (aStepName == KSurfaceScaling_Positive)                                                 testStep = new CEglTest_SurfaceScaling_Positive;
sl@0
   177
    else if (aStepName == KSurfaceScaling_WindowResize)                                             testStep = new CEglTest_SurfaceScaling_WindowResize;
sl@0
   178
    else if (aStepName == KSurfaceScaling_ExtentPositionChange)                                     testStep = new CEglTest_SurfaceScaling_ExtentPositionChange;
sl@0
   179
    else if (aStepName == KSurfaceScaling_ExtentSizeChange)                                     	testStep = new CEglTest_SurfaceScaling_ExtentSizeChange;
sl@0
   180
    else if (aStepName == KSurfaceScaling_SwapBuffers)                                     			testStep = new CEglTest_SurfaceScaling_SwapBuffers;
sl@0
   181
    else if (aStepName == KSurfaceScaling_WindowSurface_Check)                                      testStep = new CEglTest_SurfaceScaling_WindowSurface_Check;
sl@0
   182
	else if (aStepName == KSurfaceScaling_Negative_CreateWindowSurface)                             testStep = new CEglTest_SurfaceScaling_Negative_CreateWindowSurface;
sl@0
   183
    else if (aStepName == KSurfaceScaling_Negative_FixedSize_NonWindowSurface)                      testStep = new CEglTest_SurfaceScaling_Negative_FixedSize_NonWindowSurface;
sl@0
   184
    else if (aStepName == KSurfaceScalingDefaultBorderColor)                                        testStep = new CEglTest_SurfaceScalingDefaultBorderColor;
sl@0
   185
    else if (aStepName == KSurfaceScalingModifyingBorderColor)                                      testStep = new CEglTest_SurfaceScalingModifyingBorderColor;
sl@0
   186
    else if (aStepName == KSurfaceScalingModifyingBorderColorNonFixed)                          	testStep = new CEglTest_SurfaceScalingModifyingBorderColorNonFixed;
sl@0
   187
    else if (aStepName == KSurfaceScalingModifyingInvalidBorderColor)                               testStep = new CEglTest_SurfaceScalingModifyingInvalidBorderColor;
sl@0
   188
    else if (aStepName == KSurfaceScalingModifyingExtent)                                           testStep = new CEglTest_SurfaceScalingModifyingExtent;
sl@0
   189
    else if (aStepName == KSurfaceScalingModifyingExtentNonFixed)                                   testStep = new CEglTest_SurfaceScalingModifyingExtentNonFixed;
sl@0
   190
    else if (aStepName == KSurfaceScalingQuerySurface)                                              testStep = new CEglTest_SurfaceScalingQuerySurface;
sl@0
   191
    else if (aStepName == KSurfaceScalingQuerySurfaceNonFixed)                                      testStep = new CEglTest_SurfaceScalingQuerySurfaceNonFixed;
sl@0
   192
    else if (aStepName == KSurfaceScalingCapability)                                                testStep = new CEglTest_SurfaceScalingCapability;
sl@0
   193
    else if (aStepName == KSurfaceScalingSet)                                                		testStep = new CEglTest_SurfaceScalingSet;
sl@0
   194
    else if (aStepName == KSurfaceScalingSetNonFixed)                              					testStep = new CEglTest_SurfaceScalingSetNonFixed;
sl@0
   195
    else if (aStepName == KSurfaceScalingSetInvalidAttributes)                                      testStep = new CEglTest_SurfaceScalingSetInvalidAttributes;
sl@0
   196
    else if (aStepName == KSurfaceScalingNotInitialized)                                      		testStep = new CEglTest_SurfaceScalingNotInitialized;
sl@0
   197
		
sl@0
   198
	return testStep;
sl@0
   199
	}