os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/inc/tgraphicsresourcemultiprocessthread.h
Update contrib.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
17 #define TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H
20 #include <sgresource/sgimage.h>
22 class CTTMSGraphicsStep;
24 //define default slot for multiprocess communication
25 const TInt KSecondProcessFunctionSlot = 1;
26 const TInt KSecondProcessParametersSlot = 2;
29 * Enums for passing between the test process and the second process used in testing,
30 * used to define which test should be run on the second process.
35 ESgresSecondProcessOpenImage,
36 ESgresSecondProcessOpenDrawable,
37 ESgresSecondThreadOpenImage,
38 ESgresSecondThreadOpenDrawable,
39 ESgresSecondProcessOpenImageInvalid,
40 ESgresSecondThreadOpenImageInvalid,
41 ESgresSecondThreadOpenDrawableInvalid,
42 ESgresSecondProcessOpenDrawableInvalid,
43 ESgresSecondThreadPanicDrawableOpenNoDriver,
44 ESgresSecondThreadPanicImageOpenNoDriver,
45 ESgresSecondThreadPanicImageGetInterfaceInvalidHandle,
46 ESgresSecondThreadPanicImageGetInterfaceNoDriver,
47 ESgresSecondThreadPanicImageCloseInvalidHandle,
48 ESgresSecondThreadPanicImageCloseNoDriver,
49 ESgresSecondThreadPanicImageIdInvalidHandle,
50 ESgresSecondThreadPanicImageIdNoDriver,
51 ESgresSecondThreadPanicImageDrawableTypeNoDriver,
52 ESgresSecondThreadPanicImageDrawableTypeInvalidHandle,
53 ESgresSecondThreadPanicImageCreateNoDriver1,
54 ESgresSecondThreadPanicImageCreateNoDriver2,
55 ESgresSecondThreadPanicImageCreateInvalidHandle,
56 ESgresSecondThreadPanicImageGetInfoInvalidHandle,
57 ESgresSecondThreadPanicImageGetInfoNoDriver,
58 ESgresMultipleThreadStressTest,
59 ESgresSecondThreadPanicImageGetAttributeInvalidHandle,
60 ESgresSecondThreadPanicImageGetAttributeNoDriver,
61 ESgresSecondThreadPanicAttributeArrayInvalidIndex,
62 ESgresSecondThreadPanicAttributeArrayInvalidIndex2,
63 ESgresSecondProcessPanicDriverCloseOpenResources,
64 ESgresSecondThreadOpenPassedDriver,
65 ESgresSecondThreadClosePassedDriver,
66 ESgresSecondThreadCreatePassedImage,
67 ESgresSecondThreadOpenPassedImage,
68 ESgresSecondThreadClosePassedImage,
69 ESgresSecondProcessOpenImageMultithreaded,
73 * Enums for the test results. Used in multi-thread or multi-process tests.
74 * Each test function call may contain several sub-tests. Each EXXXTestPassed
75 * will be bitwised ored to the test result as each sub-test passes.
79 EFirstTestPassed = 0x00000001,
80 ESecondTestPassed = 0x00000002,
81 EThirdTestPassed = 0x00000004,
82 EFourthTestPassed = 0x00000008,
83 EFifthTestPassed = 0x00000010,
84 ESixthTestPassed = 0x00000020,
85 ESeventhTestPassed = 0x00000040,
86 EEighthTestPassed = 0x00000080,
87 ENinthTestPassed = 0x00000100,
88 ETenthTestPassed = 0x00000200,
89 EEleventhTestPassed = 0x00000400,
90 ETwelvethTestPassed = 0x00000800,
91 EThirteenthTestPassed = 0x00001000,
92 EFourteenthTestPassed = 0x00002000,
93 EFifteenthTestPassed = 0x00004000,
98 Utility class for passing test info between processes.
100 class TSgProcessTestInfo
103 TSgProcessTestInfo() :
104 iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest)
106 TSgProcessTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) :
107 iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase)
109 TSgDrawableId iDrawableId;
110 TSgImageInfo iImageInfo;
111 TSgresTestCase iTestCase;
115 Utility class for passing test info between threads.
117 class TSgThreadTestInfo
120 TSgThreadTestInfo() :
121 iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest),
122 iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL)
124 TSgThreadTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) :
125 iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase),
126 iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL)
128 TSgDrawableId iDrawableId;
129 TSgImageInfo iImageInfo;
130 TSgresTestCase iTestCase;
131 RSgDriver* iSgDriver;
133 CTTMSGraphicsStep* iTestStep;
136 // Message queue name for inter-process communication
137 _LIT(KSgTestMultiprocessMsgQ, "TestGraphicsResourceMultiprocessMsgQ");