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