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