os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/inc/tgraphicsresourcemultiprocessthread.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/inc/tgraphicsresourcemultiprocessthread.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,139 @@
1.4 +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
1.20 +#define TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <sgresource/sgimage.h>
1.24 +
1.25 +class CTTMSGraphicsStep;
1.26 +
1.27 +//define default slot for multiprocess communication
1.28 +const TInt KSecondProcessFunctionSlot = 1;
1.29 +const TInt KSecondProcessParametersSlot = 2;
1.30 +
1.31 +/**
1.32 +* Enums for passing between the test process and the second process used in testing,
1.33 +* used to define which test should be run on the second process.
1.34 +*/
1.35 +enum TSgresTestCase
1.36 + {
1.37 + ESgresUndefinedTest,
1.38 + ESgresSecondProcessOpenImage,
1.39 + ESgresSecondProcessOpenDrawable,
1.40 + ESgresSecondThreadOpenImage,
1.41 + ESgresSecondThreadOpenDrawable,
1.42 + ESgresSecondProcessOpenImageInvalid,
1.43 + ESgresSecondThreadOpenImageInvalid,
1.44 + ESgresSecondThreadOpenDrawableInvalid,
1.45 + ESgresSecondProcessOpenDrawableInvalid,
1.46 + ESgresSecondThreadPanicDrawableOpenNoDriver,
1.47 + ESgresSecondThreadPanicImageOpenNoDriver,
1.48 + ESgresSecondThreadPanicImageGetInterfaceInvalidHandle,
1.49 + ESgresSecondThreadPanicImageGetInterfaceNoDriver,
1.50 + ESgresSecondThreadPanicImageCloseInvalidHandle,
1.51 + ESgresSecondThreadPanicImageCloseNoDriver,
1.52 + ESgresSecondThreadPanicImageIdInvalidHandle,
1.53 + ESgresSecondThreadPanicImageIdNoDriver,
1.54 + ESgresSecondThreadPanicImageDrawableTypeNoDriver,
1.55 + ESgresSecondThreadPanicImageDrawableTypeInvalidHandle,
1.56 + ESgresSecondThreadPanicImageCreateNoDriver1,
1.57 + ESgresSecondThreadPanicImageCreateNoDriver2,
1.58 + ESgresSecondThreadPanicImageCreateInvalidHandle,
1.59 + ESgresSecondThreadPanicImageGetInfoInvalidHandle,
1.60 + ESgresSecondThreadPanicImageGetInfoNoDriver,
1.61 + ESgresMultipleThreadStressTest,
1.62 + ESgresSecondThreadPanicImageGetAttributeInvalidHandle,
1.63 + ESgresSecondThreadPanicImageGetAttributeNoDriver,
1.64 + ESgresSecondThreadPanicAttributeArrayInvalidIndex,
1.65 + ESgresSecondThreadPanicAttributeArrayInvalidIndex2,
1.66 + ESgresSecondProcessPanicDriverCloseOpenResources,
1.67 + ESgresSecondThreadOpenPassedDriver,
1.68 + ESgresSecondThreadClosePassedDriver,
1.69 + ESgresSecondThreadCreatePassedImage,
1.70 + ESgresSecondThreadOpenPassedImage,
1.71 + ESgresSecondThreadClosePassedImage,
1.72 + ESgresSecondProcessOpenImageMultithreaded,
1.73 + };
1.74 +
1.75 +/**
1.76 +* Enums for the test results. Used in multi-thread or multi-process tests.
1.77 +* Each test function call may contain several sub-tests. Each EXXXTestPassed
1.78 +* will be bitwised ored to the test result as each sub-test passes.
1.79 +*/
1.80 +enum TSgresTestResult
1.81 + {
1.82 + EFirstTestPassed = 0x00000001,
1.83 + ESecondTestPassed = 0x00000002,
1.84 + EThirdTestPassed = 0x00000004,
1.85 + EFourthTestPassed = 0x00000008,
1.86 + EFifthTestPassed = 0x00000010,
1.87 + ESixthTestPassed = 0x00000020,
1.88 + ESeventhTestPassed = 0x00000040,
1.89 + EEighthTestPassed = 0x00000080,
1.90 + ENinthTestPassed = 0x00000100,
1.91 + ETenthTestPassed = 0x00000200,
1.92 + EEleventhTestPassed = 0x00000400,
1.93 + ETwelvethTestPassed = 0x00000800,
1.94 + EThirteenthTestPassed = 0x00001000,
1.95 + EFourteenthTestPassed = 0x00002000,
1.96 + EFifteenthTestPassed = 0x00004000,
1.97 + };
1.98 +
1.99 +
1.100 +/**
1.101 +Utility class for passing test info between processes.
1.102 + */
1.103 +class TSgProcessTestInfo
1.104 + {
1.105 +public:
1.106 + TSgProcessTestInfo() :
1.107 + iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest)
1.108 + {}
1.109 + TSgProcessTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) :
1.110 + iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase)
1.111 + {}
1.112 + TSgDrawableId iDrawableId;
1.113 + TSgImageInfo iImageInfo;
1.114 + TSgresTestCase iTestCase;
1.115 + };
1.116 +
1.117 +/**
1.118 +Utility class for passing test info between threads.
1.119 + */
1.120 +class TSgThreadTestInfo
1.121 + {
1.122 +public:
1.123 + TSgThreadTestInfo() :
1.124 + iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest),
1.125 + iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL)
1.126 + {}
1.127 + TSgThreadTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) :
1.128 + iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase),
1.129 + iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL)
1.130 + {}
1.131 + TSgDrawableId iDrawableId;
1.132 + TSgImageInfo iImageInfo;
1.133 + TSgresTestCase iTestCase;
1.134 + RSgDriver* iSgDriver;
1.135 + RSgImage* iSgImage;
1.136 + CTTMSGraphicsStep* iTestStep;
1.137 + };
1.138 +
1.139 +// Message queue name for inter-process communication
1.140 +_LIT(KSgTestMultiprocessMsgQ, "TestGraphicsResourceMultiprocessMsgQ");
1.141 +
1.142 +#endif