|
1 // Copyright (c) 2003-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 #include "TestHttpMessage.h" |
|
17 #include <e32base.h> |
|
18 #include <e32std.h> |
|
19 #include <e32cons.h> // Console |
|
20 #include "ctestengine.h" |
|
21 // Constants |
|
22 |
|
23 _LIT(KTextConsoleTitle, "Console"); |
|
24 _LIT(KTextFailed, " failed, leave code = %d"); |
|
25 |
|
26 // Global Variables |
|
27 |
|
28 LOCAL_D CConsoleBase* console; // write all messages to this |
|
29 |
|
30 |
|
31 LOCAL_C void DoStartL() |
|
32 { |
|
33 // Create active scheduler (to run active objects) |
|
34 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); |
|
35 CleanupStack::PushL(scheduler); |
|
36 CActiveScheduler::Install(scheduler); |
|
37 |
|
38 // MainL(); |
|
39 // Create the test engine |
|
40 CTestEngine* testEngine = CTestEngine::NewL(); |
|
41 CleanupStack::PushL(testEngine); |
|
42 |
|
43 // Do tests... |
|
44 testEngine->RunTestsL(); |
|
45 // Delete active scheduler |
|
46 CleanupStack::PopAndDestroy(2,scheduler); |
|
47 } |
|
48 |
|
49 // Global Functions |
|
50 |
|
51 GLDEF_C TInt E32Main() |
|
52 { |
|
53 // Create cleanup stack |
|
54 __UHEAP_MARK; |
|
55 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
56 |
|
57 // Create output console |
|
58 TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize( |
|
59 KConsFullScreen, KConsFullScreen))); |
|
60 if (createError) |
|
61 return createError; |
|
62 |
|
63 // Run application code inside TRAP harness |
|
64 TRAPD(mainError, DoStartL()); |
|
65 if (mainError) |
|
66 console->Printf(KTextFailed, mainError); |
|
67 delete console; |
|
68 delete cleanup; |
|
69 __UHEAP_MARKEND; |
|
70 return KErrNone; |
|
71 } |
|
72 |