|
1 // Copyright (c) 2005-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 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #include "TMultipleAlarmServer.h" |
|
22 #include "TMultipleAlarmStep.h" |
|
23 |
|
24 _LIT(KServerName, "TMultipleAlarmServer"); |
|
25 |
|
26 CTMultipleAlarmServer* CTMultipleAlarmServer::NewL() |
|
27 { |
|
28 CTMultipleAlarmServer* server = new (ELeave) CTMultipleAlarmServer; |
|
29 CleanupStack::PushL(server); |
|
30 server->StartL(KServerName); |
|
31 CleanupStack::Pop(server); |
|
32 |
|
33 return server; |
|
34 } |
|
35 |
|
36 CTestStep* CTMultipleAlarmServer::CreateTestStep(const TDesC& aStepName) |
|
37 { |
|
38 |
|
39 if (aStepName == KTMultipleAlarm) |
|
40 { |
|
41 return new CTMultipleAlarmStep; |
|
42 } |
|
43 return 0; |
|
44 } |
|
45 |
|
46 static void MainL() |
|
47 { |
|
48 CActiveScheduler* sched = new(ELeave) CActiveScheduler; |
|
49 CActiveScheduler::Install(sched); |
|
50 |
|
51 CTMultipleAlarmServer* server = 0; |
|
52 TRAPD(err,server = CTMultipleAlarmServer::NewL()); |
|
53 |
|
54 if(!err) |
|
55 { |
|
56 RProcess::Rendezvous(KErrNone); |
|
57 CActiveScheduler::Start(); |
|
58 } |
|
59 |
|
60 delete server; |
|
61 delete sched; |
|
62 } |
|
63 |
|
64 GLDEF_C TInt E32Main() |
|
65 { |
|
66 __UHEAP_MARK; |
|
67 |
|
68 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
69 |
|
70 if(cleanup == NULL) |
|
71 { |
|
72 return KErrNoMemory; |
|
73 } |
|
74 |
|
75 TRAP_IGNORE(MainL()); |
|
76 delete cleanup; |
|
77 |
|
78 __UHEAP_MARKEND; |
|
79 return KErrNone; |
|
80 } |