|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description* |
|
15 */ |
|
16 |
|
17 |
|
18 // Include Files |
|
19 |
|
20 #include "VCXConnUtilTestExe.h" |
|
21 #include <e32base.h> |
|
22 #include <e32std.h> |
|
23 #include "VCXTestLog.h" |
|
24 |
|
25 #include "VCXConnUtilTestCommon.h" |
|
26 #include "CIptvTestActiveWait.h" |
|
27 #include "CIptvTestTimer.h" |
|
28 #include "VCXConnUtilTestExeTester.h" |
|
29 #include "VCXTestTimerWait.h" |
|
30 |
|
31 // Constants |
|
32 |
|
33 // Global Variables |
|
34 |
|
35 // Local Functions |
|
36 |
|
37 // Implements just Error() to avoid panic |
|
38 class CSimpleScheduler : public CActiveScheduler |
|
39 { |
|
40 void Error( TInt ) const{} // From CActiveScheduler |
|
41 }; |
|
42 |
|
43 LOCAL_C void MainL() |
|
44 { |
|
45 VCXLOGLO1(">>>VCXConnUtilTestExe ## MainL"); |
|
46 |
|
47 RProcess process; |
|
48 |
|
49 CVCXTestTimerWait* wait = CVCXTestTimerWait::NewL(); |
|
50 CleanupStack::PushL( wait ); |
|
51 |
|
52 // Create stopper class. |
|
53 CVCXConnUtilTestExeTester* stopper = CVCXConnUtilTestExeTester::NewL( process.Id() ); |
|
54 CleanupStack::PushL( stopper ); |
|
55 |
|
56 // Loop until done. |
|
57 while( stopper->Running() ) |
|
58 { |
|
59 wait->WaitL( 1000000 ); |
|
60 } |
|
61 |
|
62 VCXLOGLO1("VCXConnUtilTestExe ## Loop done!"); |
|
63 |
|
64 CleanupStack::PopAndDestroy( stopper ); |
|
65 CleanupStack::PopAndDestroy( wait ); |
|
66 |
|
67 VCXLOGLO1("<<<VCXConnUtilTestExe ## MainL"); |
|
68 } |
|
69 |
|
70 LOCAL_C void DoStartL() |
|
71 { |
|
72 // Create active scheduler (to run active objects) |
|
73 CSimpleScheduler* scheduler = new (ELeave) CSimpleScheduler(); |
|
74 CleanupStack::PushL(scheduler); |
|
75 CActiveScheduler::Install(scheduler); |
|
76 |
|
77 MainL(); |
|
78 |
|
79 // Delete active scheduler |
|
80 CleanupStack::PopAndDestroy(scheduler); |
|
81 } |
|
82 |
|
83 // Global Functions |
|
84 |
|
85 GLDEF_C TInt E32Main() |
|
86 { |
|
87 // Create cleanup stack |
|
88 //__UHEAP_MARK; |
|
89 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
90 |
|
91 // Run application code inside TRAP harness, wait keypress when terminated |
|
92 TRAPD(mainError, DoStartL()); |
|
93 if (mainError) |
|
94 |
|
95 delete cleanup; |
|
96 //__UHEAP_MARKEND; |
|
97 return KErrNone; |
|
98 } |
|
99 |