egl/egltest/src/eglteststep.cpp
changeset 0 5d03bc08d59c
child 4 15986eb6c500
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2009 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 
       
    35 /*
       
    36 Entry point from egltest to create test step
       
    37 */
       
    38 EXPORT_C CEglTestStep* EglTestStepFactory::GetEglTestStep(const TDesC& aStepName)
       
    39 // static
       
    40 	{
       
    41 	CEglTestStep* testStep = NULL;
       
    42 
       
    43 	// General tests
       
    44 	if (aStepName == KDumpStrings)																	testStep = new CEglTest_DumpStrings;
       
    45 	else if (aStepName == KQueryString_Extensions)													testStep = new CEglTest_QueryString_Extensions;
       
    46     else if (aStepName == KEglTerminate_Negative)                                                   testStep = new CEglTest_EglTerminate_Negative;
       
    47     else if (aStepName == KGeneral_Negative_ProcAddress)                                            testStep = new CEglTest_General_Negative_ProcAddress;
       
    48 
       
    49     // GetError and Display tests
       
    50     else if (aStepName == KGetError)                                                                testStep = new CEglTest_GetError;
       
    51     else if (aStepName == KGetErrorMultiThread)                                                     testStep = new CEglTest_GetErrorMultiThread;
       
    52     else if (aStepName == KDisplay_Positive_Basic)                                                  testStep = new CEglTest_Display_Positive_Basic;
       
    53     else if (aStepName == KDisplay_Negative_InvalidDisplay)                                         testStep = new CEglTest_Display_Negative_InvalidDisplay;
       
    54     else if (aStepName == KDisplay_Negative_NotInitializedDisplay)                                  testStep = new CEglTest_Display_Negative_NotInitializedDisplay;   
       
    55     else if (aStepName == KDisplay_Positive_ReinitializeDisplay)                                    testStep = new CEglTest_Display_Positive_ReinitializeDisplay;
       
    56     else if (aStepName == KDisplay_Positive_MultipleInitialization)                                 testStep = new CEglTest_Display_Positive_MultipleInitialization;
       
    57     else if (aStepName == KDisplay_Positive_MultipleTermination)                                    testStep = new CEglTest_Display_Positive_MultipleTermination;
       
    58     else if (aStepName == KDisplay_Positive_Multithread_Basic)                                      testStep = new CEglTest_Display_Positive_Multithread_Basic;
       
    59     else if (aStepName == KDisplay_Positive_Multithread_InitTerminateInOneTread)                    testStep = new CEglTest_Display_Positive_Multithread_InitTerminateInOneTread;
       
    60     else if (aStepName == KDisplay_Positive_Multithread_InitTerminateFromDifferentThread)           testStep = new CEglTest_Display_Positive_Multithread_InitTerminateFromDifferentThread;
       
    61     else if (aStepName == KDisplay_Positive_Multithread_Stress)                                     testStep = new CEglTest_Display_Positive_Multithread_Stress;
       
    62     else if (aStepName == KDisplay_Positive_Multiprocess_Basic)                                     testStep = new CEglTest_Display_Positive_Multiprocess_Basic;
       
    63     else if (aStepName == KDisplay_OOM_ClientHeap)                                                  testStep = new CEglTest_Display_OOM_ClientHeap;
       
    64     else if (aStepName == KDisplay_OOM_ClientHeap_Initialize)                                       testStep = new CEglTest_Display_OOM_ClientHeap_Initialize;
       
    65 
       
    66 	//SyncObject tests excluding WaitFlush which requires OpenVG and OpenGL ES
       
    67 	else if (aStepName == KSyncObject_Positive_GetProcAddress)											testStep = new CEglTest_SyncObject_Positive_GetProcAddress;
       
    68 	else if (aStepName == KSyncObject_Positive_CreateDestroy)										testStep = new CEglTest_SyncObject_Positive_CreateDestroy;
       
    69 	else if (aStepName == KSyncObject_Positive_WaitSignal)											testStep = new CEglTest_SyncObject_Positive_WaitSignal;
       
    70 	else if (aStepName == KSyncObject_Positive_WaitSignal2)											testStep = new CEglTest_SyncObject_Positive_WaitSignal2;
       
    71 	else if (aStepName == KSyncObject_Positive_WaitDelete)											testStep = new CEglTest_SyncObject_Positive_WaitDelete;
       
    72 	else if (aStepName == KSyncObject_Positive_WaitWithTimeoutExpired)								testStep = new CEglTest_SyncObject_Positive_WaitWithTimeoutExpired;
       
    73 	else if (aStepName == KSyncObject_Positive_SignalBeforeTimeoutExpired)							testStep = new CEglTest_SyncObject_Positive_SignalBeforeTimeoutExpired;
       
    74 	else if (aStepName == KSyncObject_Positive_DeleteBeforeTimeoutExpired)							testStep = new CEglTest_SyncObject_Positive_DeleteBeforeTimeoutExpired;
       
    75 	else if (aStepName == KSyncObject_Positive_Multithread_SignalBeforeTimeout)						testStep = new CEglTest_SyncObject_Positive_Multithread_SignalBeforeTimeout;
       
    76 	else if (aStepName == KSyncObject_Positive_Multithread_SignalAfterTimeout)						testStep = new CEglTest_SyncObject_Positive_Multithread_SignalAfterTimeout;
       
    77 	else if (aStepName == KSyncObject_Positive_Multithread_WaitOnTwoSyncObject)						testStep = new CEglTest_SyncObject_Positive_Multithread_WaitOnTwoSyncObject;
       
    78 	else if (aStepName == KSyncObject_Positive_Wait_TestMode)										testStep = new CEglTest_SyncObject_Positive_Wait_TestMode;
       
    79 	else if (aStepName == KSyncObject_Positive_Multithread_Deletion)								testStep = new CEglTest_SyncObject_Positive_Multithread_Deletion;
       
    80 	else if (aStepName == KSyncObject_Positive_Terminate)                                           testStep = new CEglTest_SyncObject_Positive_Terminate;
       
    81 	else if (aStepName == KSyncObject_Positive_TerminateBeforeTimeoutExpired)                       testStep = new CEglTest_SyncObject_Positive_TerminateBeforeTimeoutExpired; 
       
    82 	else if (aStepName == KSyncObject_Positive_Stress)												testStep = new CEglTest_SyncObject_Positive_Stress;
       
    83 	else if (aStepName == KSyncObject_Negative_WrongParameters)										testStep = new CEglTest_SyncObject_Negative_WrongParameters;
       
    84 	else if (aStepName == KSyncObject_Negative_SignalImpl)											testStep = new CEglTest_SyncObject_Negative_SignalImpl;
       
    85 	else if (aStepName == KSyncObject_Negative_OOM)													testStep = new CEglTest_SyncObject_Negative_OOM;
       
    86 	// SyncObjecte WaitFlush test is implementation specific as it uses OpenVG and OpenGL ES
       
    87 	else if (aStepName == KSyncObject_Positive_WaitFlush)                                           testStep = new CEglTest_SyncObject_Positive_WaitFlush;
       
    88 
       
    89 	// NativePixmapType tests
       
    90 	else if (aStepName == KNativePixmapType_SingleThread_Positive_RSgImage)							testStep = new CEglTest_NativePixmapType_SingleThread_Positive_RSgImage;	
       
    91 	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitTwice)				testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitTwice;
       
    92 	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitTwice_NoRendezvous)	testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitTwice_NoRendezvous;
       
    93 	else if (aStepName == KNativePixmapType_MultiThread_Positive_RSgImage_InitOneThreadOnly)		testStep = new CEglTest_NativePixmapType_MultiThread_Positive_RSgImage_InitOneThreadOnly;	
       
    94 	else if (aStepName == KNativePixmapType_MultiProcess_Both_RSgImage)								testStep = new CEglTest_NativePixmapType_MultiProcess_Both_RSgImage;
       
    95 	else if (aStepName == KChooseConfig_EGL_MATCH_NATIVE_PIXMAP_KHR)								testStep = new CEglTest_ChooseConfig_EGL_MATCH_NATIVE_PIXMAP_KHR;
       
    96 	else if (aStepName == KCFbsBitmap_EGL_MATCH_NATIVE_PIXMAP_KHR)									testStep = new CEglTest_CFbsBitmap_EGL_MATCH_NATIVE_PIXMAP_KHR;
       
    97 
       
    98 	// CreatePixmapSurface tests
       
    99 	else if (aStepName == KCreatePixmapSurface_RSgImage_Negative_RSgImage_NotInitialised)			testStep = new CEglTest_CreatePixmapSurface_RSgImage_Negative_RSgImage_NotInitialised;
       
   100 	else if (aStepName == KCreatePixmapSurface_Negative_Invalid_Pixmap_Type)						testStep = new CEglTest_CreatePixmapSurface_Negative_Invalid_Pixmap_Type;
       
   101 	else if (aStepName == KCreatePixmapSurface_Alpha_bit_RSgImage)									testStep = new CEglTest_CreatePixmapSurface_Alpha_bit_RSgImage;
       
   102     else if (aStepName == KCreatePixmapSurface_RSgImage_Positive_MantadoryFormatUsageSupport)       testStep = new CEglTest_CreatePixmapSurface_RSgImage_Positive_MantadoryFormatUsageSupport;
       
   103 
       
   104 	// image tests
       
   105 	else if (aStepName == KEGL_Image_SgDriverHandle)												testStep = new CEglTest_EGL_Image_SgDriverHandle;
       
   106 	else if (aStepName == KEGL_Image_RSgImage_UseOpenVG_PersistImageData)							testStep = new CEglTest_EGL_Image_RSgImage_UseOpenVG_PersistImageData;
       
   107 	else if (aStepName == KEGL_Image_Consistent_Linked_List)										testStep = new CEglTest_EGL_Image_Consistent_Linked_List;	
       
   108 
       
   109 	// image negative tests
       
   110 	else if (aStepName == KEGL_Image_eglCreateImage_Bad_Parameter)									testStep = new CEglTest_EGL_Image_eglCreateImage_Bad_Parameter;
       
   111 	else if (aStepName == KEGL_Image_UsageBits_Enforcement)											testStep = new CEglTest_EGL_Image_UsageBits_Enforcement;
       
   112 	else if (aStepName == KEGL_Image_DestroyImageKHR)												testStep = new CEglTest_EGL_Image_DestroyImageKHR;	
       
   113 	else if (aStepName == KEGL_Image_VGImage_From_Invalid_EGLHandle)								testStep = new CEglTest_EGL_Image_VGImage_From_Invalid_EGLHandle;
       
   114 	else if (aStepName == KEGL_Image_Self_Drawing)													testStep = new CEglTest_EGL_Image_Self_Drawing;
       
   115 
       
   116 	//Siblings tests
       
   117 	else if (aStepName == KEGL_Image_Sibling_Basic)													testStep = new CEglTest_EGL_Image_Sibling_Basic;
       
   118 	else if (aStepName == KEGL_Image_Sibling_VGImage)												testStep = new CEglTest_EGL_Image_Sibling_VGImage;
       
   119 	else if (aStepName == KEGL_Image_Sibling_Two_VGImages)											testStep = new CEglTest_EGL_Image_Sibling_Two_VGImages;
       
   120 	else if (aStepName == KEGL_Image_Sibling_VGImage_Child)											testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child;
       
   121 	else if (aStepName == KEGL_Image_Sibling_VGImage_Child_CheckContents)							testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child_CheckContents;
       
   122 	else if (aStepName == KEGL_Image_Sibling_VGImage_Child_CheckContents_CloseSgEarlier)			testStep = new CEglTest_EGL_Image_Sibling_VGImage_Child_CheckContents_CloseSgEarlier;
       
   123 	else if (aStepName == KEGL_Image_CreatePBufferFromClient_With_Sibling_VGImage)					testStep = new CEglTest_EGL_Image_CreatePBufferFromClient_With_Sibling_VGImage;
       
   124 
       
   125 	//VgImage to surfaces tests
       
   126 	else if (aStepName == KEGL_Image_VgImage_To_Pixmap)												testStep = new CEglTest_EGL_Image_VgImage_To_Pixmap;
       
   127 	else if (aStepName == KEGL_Image_VGImage_To_Pixmap_CFbs)										testStep = new CEglTest_EGL_Image_VGImage_To_Pixmap_CFbs;
       
   128 	else if (aStepName == KEGL_Image_VgImage_To_pBuffer)											testStep = new CEglTest_EGL_Image_VgImage_To_pBuffer;
       
   129 	else if (aStepName == KEGL_Image_VgImage_To_Window)												testStep = new CEglTest_EGL_Image_VgImage_To_Window;
       
   130 
       
   131 	//MultiThreaded
       
   132 	else if (aStepName == KEGL_Image_Multi_Thread_Parallel)											testStep = new CEglTest_EGL_Image_Multi_Thread_Parallel;
       
   133 	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_Basic)									testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_Basic;
       
   134 	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_VGImage)									testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_VGImage;
       
   135 	else if (aStepName == KEGL_Image_Multi_Thread_Sibling_VGImage_PassingEGLImage)					testStep = new CEglTest_EGL_Image_Multi_Thread_Sibling_VGImage_PassingEGLImage;
       
   136 	else if (aStepName == KEGL_Image_Multi_Thread_Exit_Thread)										testStep = new CEglTest_EGL_Image_Multi_Thread_Exit_Thread;
       
   137 	else if (aStepName == KEGL_Image_Multi_Thread_DrawAfterTerminate)								testStep = new CEglTest_EGL_Image_Multi_Thread_DrawAfterTerminate;
       
   138 	
       
   139     //MultiProcess
       
   140 	else if (aStepName == KEGL_Image_Multi_Process_Parallel)										testStep = new CEglTest_EGL_Image_Multi_Process_Parallel;
       
   141 	else if (aStepName == KEGL_Image_Multi_Process_Sibling_Basic)									testStep = new CEglTest_EGL_Image_Multi_Process_Sibling_Basic;
       
   142 	else if (aStepName == KEGL_Image_Multi_Process_Sibling_CheckContents)							testStep = new CEglTest_EGL_Image_Multi_Process_Sibling_CheckContents;
       
   143 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_Source)									testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_Source;
       
   144 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_DrawAfterTerminate)						testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_DrawAfterTerminate;
       
   145 	else if (aStepName == KEGL_Image_Multi_Process_FontServer_Upfront)								testStep = new CEglTest_EGL_Image_Multi_Process_FontServer_Upfront;
       
   146 	else if (aStepName == KEGL_Image_Multi_Process_FontServer_Deferred)								testStep = new CEglTest_EGL_Image_Multi_Process_FontServer_Deferred;
       
   147 	else if (aStepName == KEGL_Image_Multi_Process_ThemeServer)										testStep = new CEglTest_EGL_Image_Multi_Process_ThemeServer;
       
   148 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ProcessTerminate)						testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ProcessTerminate;
       
   149 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ProcessTerminate2)						testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ProcessTerminate2;
       
   150 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ProcessTerminateNegative)				testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ProcessTerminateNegative;
       
   151 	else if (aStepName == KEGL_Image_Multi_Process_VgImage_ReadWrite)								testStep = new CEglTest_EGL_Image_Multi_Process_VgImage_ReadWrite;
       
   152 
       
   153 	// Benchmark
       
   154     else if (aStepName == KBenchmark_CreateCloseImage)                                              testStep = new CEglTest_Benchmark_CreateCloseImage;
       
   155     else if (aStepName == KBenchmark_Multi_Process_CreateCloseImage)                                testStep = new CEglTest_Benchmark_Multi_Process_CreateCloseImage;
       
   156     else if (aStepName == KBenchmark_DrawImage)                                                     testStep = new CEglTest_Benchmark_DrawImage;
       
   157 
       
   158 	return testStep;
       
   159 	}