|
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 // This file contains the CTestAlarmServer class. |
|
15 // that represents our Test Server.This file also |
|
16 // contains the TASStartupSignaller class used for |
|
17 // starting up the Alarm Server. |
|
18 // |
|
19 // |
|
20 |
|
21 #if (!defined CAP_Alarm_SERVER_H_) |
|
22 #define CAP_Alarm_SERVER_H_ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32svr.h> |
|
26 |
|
27 #include "f32file.h" |
|
28 #include "e32test.h" |
|
29 |
|
30 #include <test/testexecutestepbase.h> |
|
31 #include <test/testexecuteserverbase.h> |
|
32 |
|
33 // Alarm Server headers. For starting Alarm Server, building the |
|
34 // correct parameters for IPCs etc. |
|
35 #include "asshddefs.h" |
|
36 #include "ascliclientutils.h" |
|
37 #include "asshdalarm.h" |
|
38 #include "asclisession.h" |
|
39 |
|
40 // The two ways to get thru |
|
41 #define API_RETVALUE_SERVERPANIC 0 |
|
42 #define API_RETVALUE_NOCAPERROR 0 |
|
43 |
|
44 // The only way to get rejected |
|
45 #define API_RETVALUE_PERMISSIONDENIED 1 |
|
46 #define DEBUG_ONLY 1 |
|
47 #define DYNAMIC_IPC 2 |
|
48 |
|
49 // No. of Message slots |
|
50 const TInt KAlarmServerAsynchronousSlotCount = 5; |
|
51 |
|
52 class CTestAlarmServer : public CTestServer |
|
53 { |
|
54 public: |
|
55 static CTestAlarmServer* NewL(); |
|
56 virtual CTestStep* CreateTestStep(const TDesC& aStepName); |
|
57 }; |
|
58 |
|
59 class CCapabilityTestStep : public CTestStep, public RSessionBase |
|
60 { |
|
61 |
|
62 public: |
|
63 enum TDbgFns |
|
64 { |
|
65 MarkHeapStart, |
|
66 MarkHeapEnd, |
|
67 CheckHeap, |
|
68 FailNext, |
|
69 ResetFailNext |
|
70 }; |
|
71 public: |
|
72 // This is for the scheduler test framework |
|
73 virtual TVerdict doTestStepPreambleL( void ); |
|
74 virtual TVerdict doTestStepPostambleL( void ); |
|
75 virtual enum TVerdict doTestStepL(); |
|
76 |
|
77 // Stuff that derived classes need to implement |
|
78 virtual TVersion Version()=0; |
|
79 virtual TInt Exec_SendReceiveL()=0; |
|
80 |
|
81 TInt StartServer() ; |
|
82 |
|
83 TVerdict MainThread(); |
|
84 |
|
85 TVerdict GetVerdict(TInt aAPIretValue); |
|
86 |
|
87 TVerdict GetVerdict(TExitType aExit,TInt aInitRetValue, TInt aApiRetValue); |
|
88 |
|
89 TInt TestDebugHeap(TInt* aDbgIPCNo); |
|
90 |
|
91 static TAlarmId GetAlarmId(); |
|
92 |
|
93 // from CStep.h |
|
94 #define SR_MESSAGE_TYPE_CHNGED 2 |
|
95 #define SR_MESSAGE_ID_CHNGED 10 |
|
96 #define SR_ServerName_CHNGED _L("FLogger server") |
|
97 |
|
98 #define SR_CAPTEST_INVERSE 0 |
|
99 |
|
100 CActiveScheduler* iTestScheduler; |
|
101 |
|
102 /** The Server Name (eg: CommServer, EtelServer,FLogger server, etc)*/ |
|
103 TBuf<100> iSrServerName; |
|
104 |
|
105 /** iServerPanic is a unique name from Server,but always truncated to KMaxExitCategoryName*/ |
|
106 TBuf<100> iServerPanic; |
|
107 |
|
108 /** Following flags influence inverse tests*/ |
|
109 TBool iExpectRejection; |
|
110 |
|
111 TUint32 iStepCap; |
|
112 |
|
113 /** Is it Async or sync?*/ |
|
114 TInt iSrMessageType; |
|
115 |
|
116 /** It holds the IPC number*/ |
|
117 TInt iSrMessageId; |
|
118 |
|
119 /** Holds the cap mask for the message*/ |
|
120 TUint32 iSrMessageMask; |
|
121 |
|
122 /** We name the child thread appended by the IPC_Number it tests*/ |
|
123 TBuf<100> iSrChildThread; |
|
124 |
|
125 /** The flag informs the main thread whether the connection to the server was established*/ |
|
126 volatile TBool iSessionCreated; |
|
127 |
|
128 /** To find out if an Async message was completed and if then with what result?*/ |
|
129 TRequestStatus iSrRequestStatus; |
|
130 |
|
131 /** For an Sync message, nResult_SR get you the return value*/ |
|
132 TInt iResultSr; |
|
133 |
|
134 /** Hold the retusn value from "CreateSession" API*/ |
|
135 TInt iResultServer; |
|
136 |
|
137 TInt iResultC32; |
|
138 |
|
139 TInt iOptions; |
|
140 |
|
141 /** The Child thread object*/ |
|
142 RThread iChildThread; |
|
143 }; |
|
144 |
|
145 #endif /* CAP_Alarm_SERVER_H_ */ |
|
146 |