|
1 // Copyright (c) 2009-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent |
|
20 */ |
|
21 |
|
22 #include "tgraphicsresourceinternalsecondprocessenums.h" |
|
23 #include "tsgimagegeneric.h" |
|
24 #include "tsgdrawablegeneric.h" |
|
25 #include "tgraphicsresourceinternalsecondprocesstesthandler.h" |
|
26 |
|
27 TInt MainL() |
|
28 { |
|
29 TInt procHandles1 = 0; |
|
30 TInt threadHandles1 = 0; |
|
31 RThread().HandleCount(procHandles1, threadHandles1); |
|
32 |
|
33 TPckgBuf<TSgResIntTestInfo> infoPkg; |
|
34 User::LeaveIfError(User::GetDesParameter(KSecondProcessParametersSlot, infoPkg)); |
|
35 TSgResIntTestInfo& info = infoPkg(); |
|
36 TInt result = 0; |
|
37 |
|
38 CTSgResInternalSecondProcessTestHandler* handler = CTSgResInternalSecondProcessTestHandler::NewLC(); |
|
39 handler->OpenDriverL(); |
|
40 |
|
41 result = handler->RunTestCaseL(info); |
|
42 CleanupStack::PopAndDestroy(handler); |
|
43 |
|
44 // Handle check |
|
45 if (!(result < KErrNone)) |
|
46 { |
|
47 TInt procHandles2 =0; |
|
48 TInt threadHandles2=0; |
|
49 RThread().HandleCount(procHandles2,threadHandles2); |
|
50 if (threadHandles1 != threadHandles2) |
|
51 { |
|
52 result = KErrBadHandle; // Thread-owned handles not closed |
|
53 } |
|
54 } |
|
55 |
|
56 return result; |
|
57 } |
|
58 |
|
59 GLDEF_C TInt E32Main() |
|
60 { |
|
61 __UHEAP_MARK; |
|
62 CTrapCleanup* cleanupStack = CTrapCleanup::New(); |
|
63 if(cleanupStack == NULL) |
|
64 { |
|
65 return KErrNoMemory; |
|
66 } |
|
67 TInt result = 0; |
|
68 TRAPD(ret, result=MainL()); |
|
69 |
|
70 if (ret != KErrNone) |
|
71 User::Panic(_L("SGRESTEST"), 0); |
|
72 |
|
73 delete cleanupStack; |
|
74 __UHEAP_MARKEND; |
|
75 return result; |
|
76 } |