os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/inc/tgraphicsresourcemultiprocessthread.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-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
#ifndef TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
sl@0
    17
#define TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <sgresource/sgimage.h>
sl@0
    21
sl@0
    22
class CTTMSGraphicsStep;
sl@0
    23
sl@0
    24
//define default slot for multiprocess communication
sl@0
    25
const TInt KSecondProcessFunctionSlot = 1;
sl@0
    26
const TInt KSecondProcessParametersSlot = 2;
sl@0
    27
sl@0
    28
/**
sl@0
    29
* Enums for passing between the test process and the second process used in testing,
sl@0
    30
* used to define which test should be run on the second process.
sl@0
    31
*/
sl@0
    32
enum TSgresTestCase
sl@0
    33
	{
sl@0
    34
	ESgresUndefinedTest,
sl@0
    35
	ESgresSecondProcessOpenImage,
sl@0
    36
	ESgresSecondProcessOpenDrawable,
sl@0
    37
	ESgresSecondThreadOpenImage,
sl@0
    38
	ESgresSecondThreadOpenDrawable,
sl@0
    39
	ESgresSecondProcessOpenImageInvalid,
sl@0
    40
	ESgresSecondThreadOpenImageInvalid,
sl@0
    41
	ESgresSecondThreadOpenDrawableInvalid,
sl@0
    42
	ESgresSecondProcessOpenDrawableInvalid,
sl@0
    43
	ESgresSecondThreadPanicDrawableOpenNoDriver,
sl@0
    44
	ESgresSecondThreadPanicImageOpenNoDriver,
sl@0
    45
	ESgresSecondThreadPanicImageGetInterfaceInvalidHandle,
sl@0
    46
	ESgresSecondThreadPanicImageGetInterfaceNoDriver,
sl@0
    47
	ESgresSecondThreadPanicImageCloseInvalidHandle,
sl@0
    48
	ESgresSecondThreadPanicImageCloseNoDriver,
sl@0
    49
	ESgresSecondThreadPanicImageIdInvalidHandle,
sl@0
    50
	ESgresSecondThreadPanicImageIdNoDriver,
sl@0
    51
	ESgresSecondThreadPanicImageDrawableTypeNoDriver,
sl@0
    52
	ESgresSecondThreadPanicImageDrawableTypeInvalidHandle,
sl@0
    53
	ESgresSecondThreadPanicImageCreateNoDriver1,
sl@0
    54
	ESgresSecondThreadPanicImageCreateNoDriver2,
sl@0
    55
	ESgresSecondThreadPanicImageCreateInvalidHandle,
sl@0
    56
	ESgresSecondThreadPanicImageGetInfoInvalidHandle,
sl@0
    57
	ESgresSecondThreadPanicImageGetInfoNoDriver,
sl@0
    58
	ESgresMultipleThreadStressTest,
sl@0
    59
	ESgresSecondThreadPanicImageGetAttributeInvalidHandle,
sl@0
    60
	ESgresSecondThreadPanicImageGetAttributeNoDriver,
sl@0
    61
	ESgresSecondThreadPanicAttributeArrayInvalidIndex,
sl@0
    62
	ESgresSecondThreadPanicAttributeArrayInvalidIndex2,
sl@0
    63
	ESgresSecondProcessPanicDriverCloseOpenResources,
sl@0
    64
	ESgresSecondThreadOpenPassedDriver,
sl@0
    65
	ESgresSecondThreadClosePassedDriver,
sl@0
    66
	ESgresSecondThreadCreatePassedImage,
sl@0
    67
	ESgresSecondThreadOpenPassedImage,
sl@0
    68
	ESgresSecondThreadClosePassedImage,
sl@0
    69
	ESgresSecondProcessOpenImageMultithreaded,
sl@0
    70
	};
sl@0
    71
sl@0
    72
/**
sl@0
    73
* Enums for the test results. Used in multi-thread or multi-process tests.
sl@0
    74
* Each test function call may contain several sub-tests. Each EXXXTestPassed
sl@0
    75
* will be bitwised ored to the test result as each sub-test passes.
sl@0
    76
*/
sl@0
    77
enum TSgresTestResult
sl@0
    78
	{
sl@0
    79
	EFirstTestPassed = 0x00000001,
sl@0
    80
	ESecondTestPassed = 0x00000002,
sl@0
    81
	EThirdTestPassed = 0x00000004,
sl@0
    82
	EFourthTestPassed = 0x00000008,
sl@0
    83
	EFifthTestPassed = 0x00000010,
sl@0
    84
	ESixthTestPassed = 0x00000020,
sl@0
    85
	ESeventhTestPassed = 0x00000040,
sl@0
    86
	EEighthTestPassed = 0x00000080,
sl@0
    87
	ENinthTestPassed = 0x00000100,
sl@0
    88
	ETenthTestPassed = 0x00000200,
sl@0
    89
	EEleventhTestPassed = 0x00000400,
sl@0
    90
	ETwelvethTestPassed = 0x00000800,
sl@0
    91
	EThirteenthTestPassed = 0x00001000,
sl@0
    92
	EFourteenthTestPassed = 0x00002000,
sl@0
    93
	EFifteenthTestPassed = 0x00004000,
sl@0
    94
	};
sl@0
    95
	
sl@0
    96
	
sl@0
    97
/**
sl@0
    98
Utility class for passing test info between processes.
sl@0
    99
 */	
sl@0
   100
class TSgProcessTestInfo 
sl@0
   101
	{
sl@0
   102
public:
sl@0
   103
	TSgProcessTestInfo() : 
sl@0
   104
		iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest)
sl@0
   105
		{} 
sl@0
   106
	TSgProcessTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : 
sl@0
   107
			iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase)
sl@0
   108
			{}	
sl@0
   109
	TSgDrawableId iDrawableId;
sl@0
   110
	TSgImageInfo iImageInfo;
sl@0
   111
	TSgresTestCase iTestCase;
sl@0
   112
	};
sl@0
   113
sl@0
   114
/**
sl@0
   115
Utility class for passing test info between threads.
sl@0
   116
 */
sl@0
   117
class TSgThreadTestInfo 
sl@0
   118
	{
sl@0
   119
public:
sl@0
   120
	TSgThreadTestInfo() : 
sl@0
   121
		iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest), 
sl@0
   122
		iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) 
sl@0
   123
		{}
sl@0
   124
	TSgThreadTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : 
sl@0
   125
		iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase), 
sl@0
   126
		iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) 
sl@0
   127
		{}
sl@0
   128
	TSgDrawableId iDrawableId;
sl@0
   129
	TSgImageInfo iImageInfo;
sl@0
   130
	TSgresTestCase iTestCase;
sl@0
   131
	RSgDriver* iSgDriver;
sl@0
   132
	RSgImage* iSgImage;
sl@0
   133
	CTTMSGraphicsStep* iTestStep;
sl@0
   134
	};
sl@0
   135
sl@0
   136
// Message queue name for inter-process communication
sl@0
   137
_LIT(KSgTestMultiprocessMsgQ, "TestGraphicsResourceMultiprocessMsgQ");
sl@0
   138
sl@0
   139
#endif