|
1 // Copyright (c) 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 //CLayer test server(tclayer_serverwithssm.exe) |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #include <ssm/ssmswp.h> |
|
23 |
|
24 #include "tclayer_serverwithssm.h" |
|
25 #include "tclayer_step_startersessionwithssm.h" |
|
26 |
|
27 _LIT(KCLayerTestServerName, "CLayerTestServerWithSsm"); |
|
28 _LIT(KCLayerTestWrapper, "CLayerTestWrapper"); |
|
29 |
|
30 CCLayerTestServerWithSsm* CCLayerTestServerWithSsm::NewL( ) |
|
31 { |
|
32 CCLayerTestServerWithSsm * server = new (ELeave) CCLayerTestServerWithSsm(); |
|
33 CleanupStack::PushL(server); |
|
34 server->ConstructL(); |
|
35 CleanupStack::Pop(server); |
|
36 return server; |
|
37 } |
|
38 |
|
39 CCLayerTestServerWithSsm::CCLayerTestServerWithSsm() |
|
40 { |
|
41 |
|
42 } |
|
43 |
|
44 CCLayerTestServerWithSsm::~CCLayerTestServerWithSsm() |
|
45 { |
|
46 |
|
47 } |
|
48 |
|
49 static void MainL() |
|
50 { |
|
51 CActiveScheduler* sched = new(ELeave) CActiveScheduler; |
|
52 CleanupStack::PushL(sched); |
|
53 CActiveScheduler::Install (sched); |
|
54 |
|
55 CCLayerTestServerWithSsm* server = NULL; |
|
56 server = CCLayerTestServerWithSsm::NewL(); |
|
57 if(server) |
|
58 { |
|
59 RProcess::Rendezvous (KErrNone); |
|
60 sched->Start(); |
|
61 } |
|
62 delete server; |
|
63 CleanupStack::PopAndDestroy();// sched; |
|
64 } |
|
65 |
|
66 /** |
|
67 Process entry point. Called by client using RProcess API |
|
68 @return - Standard Epoc error code on process exit |
|
69 */ |
|
70 |
|
71 TInt E32Main(void) |
|
72 { |
|
73 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
74 if(cleanup == NULL) |
|
75 { |
|
76 return KErrNoMemory; |
|
77 } |
|
78 TRAPD(err,MainL()); |
|
79 if (err) |
|
80 { |
|
81 _LIT(KMainErrorStatement, "CCLayerTestServerWithSsm::MainL - Error: %d"); |
|
82 RDebug::Print(KMainErrorStatement, err); |
|
83 User::Panic(KCLayerTestServerName, err); |
|
84 } |
|
85 delete cleanup; |
|
86 return err; |
|
87 } //lint -esym(765, E32Main) Suppress 'E32Main' could be made static |
|
88 //lint -esym(714, E32Main) Suppress 'E32Main' not referenced |
|
89 |
|
90 CTestBlockController* CCLayerTestServerWithSsm::CreateTestBlock() |
|
91 { |
|
92 CTestBlockController* controller = NULL; |
|
93 TRAPD(err, (controller = new (ELeave) CCLayerTestBlock())); |
|
94 if(KErrNone != err) |
|
95 { |
|
96 User::Panic(KCLayerTestServerName, err); |
|
97 } |
|
98 return controller; |
|
99 } |
|
100 |
|
101 CDataWrapper* CCLayerTestBlock::CreateDataL(const TDesC& aData) |
|
102 { |
|
103 // Print out the parameters for debugging |
|
104 CDataWrapper* wrapper = NULL; |
|
105 if (KCLayerTestWrapper() == aData) |
|
106 { |
|
107 wrapper = CCLayerTestWrapperWithSsm::NewL(); |
|
108 } |
|
109 return wrapper; |
|
110 } |