|
1 // Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // $FILENAME.cpp |
|
15 // This file was generated automatically from the template hcitestserversource.tmpl |
|
16 // on $GENERATE_TIME_STAMP |
|
17 // Implementation of test step $CLASSNAME. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent |
|
24 */ |
|
25 |
|
26 #include "$FILENAME.h" |
|
27 |
|
28 $TEST_STEP_HEADERS |
|
29 |
|
30 _LIT(KServerName, "$SERVERNAME"); |
|
31 |
|
32 $CLASSNAME* $CLASSNAME::NewL() |
|
33 { |
|
34 $CLASSNAME *server = new(ELeave) $CLASSNAME; |
|
35 CleanupStack::PushL(server); |
|
36 server->StartL(KServerName); |
|
37 CleanupStack::Pop(server); |
|
38 return server; |
|
39 } |
|
40 |
|
41 $CLASSNAME::$CLASSNAME() |
|
42 { |
|
43 } |
|
44 |
|
45 $CLASSNAME::~$CLASSNAME() |
|
46 { |
|
47 } |
|
48 |
|
49 CTestStep* $CLASSNAME::CreateTestStep(const TDesC& aStepName) |
|
50 { |
|
51 $CREATE_TEST_STEP_IMPL |
|
52 } |
|
53 |
|
54 static void MainL() |
|
55 { |
|
56 __UHEAP_MARK; |
|
57 CActiveScheduler* sched = new (ELeave) CActiveScheduler; |
|
58 CActiveScheduler::Install(sched); |
|
59 $CLASSNAME* server; |
|
60 |
|
61 TRAPD(err,server = $CLASSNAME::NewL()); |
|
62 |
|
63 if(!err) |
|
64 { |
|
65 RProcess::Rendezvous(KErrNone); |
|
66 sched->Start(); |
|
67 } |
|
68 |
|
69 delete sched; |
|
70 __UHEAP_MARKEND; |
|
71 } |
|
72 |
|
73 TInt E32Main() |
|
74 { |
|
75 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
76 |
|
77 if(cleanup == NULL) |
|
78 { |
|
79 return KErrNoMemory; |
|
80 } |
|
81 |
|
82 TRAP_IGNORE(MainL()); |
|
83 delete cleanup; |
|
84 return KErrNone; |
|
85 } |