|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Definition of CTFDosServerControlTestCase |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CTFDOSSERVERCONTROLTESTCASE_H__ |
|
21 #define __CTFDOSSERVERCONTROLTESTCASE_H__ |
|
22 |
|
23 #include <mtfaactivetest.h> |
|
24 #include <ctfstubtestcase.h> |
|
25 #include "tfdostypes.h" |
|
26 |
|
27 class CTFATestTimer; |
|
28 class CTFDosControlTestCaseParam; |
|
29 |
|
30 #define TF_DOS_SERVER_CONTROL_TEST_CASE_L( aCaseId, aCaseStates ) \ |
|
31 case aCaseId: \ |
|
32 { \ |
|
33 CTFDosControlTestCaseParam* param = new ( ELeave ) CTFDosControlTestCaseParam(); \ |
|
34 CleanupStack::PushL( param ); \ |
|
35 param->ConstructL( aCaseStates, sizeof ( aCaseStates ) / sizeof ( TTFDosServerControlTestCaseState ) ); \ |
|
36 returnValue = new ( ELeave ) CTFDosControlTestCase( param ); \ |
|
37 CleanupStack::Pop(); \ |
|
38 CleanupStack::PushL( returnValue ); \ |
|
39 STATIC_CAST( CTFDosControlTestCase*, returnValue )->ConstructL(); \ |
|
40 CleanupStack::Pop(); \ |
|
41 } \ |
|
42 break |
|
43 |
|
44 class CTFDosControlTestCase : public CTFStubTestCase, public MTFAActiveTest |
|
45 { |
|
46 public: |
|
47 CTFDosControlTestCase( CTFDosControlTestCaseParam* aParameters ); |
|
48 void ConstructL( void ); |
|
49 ~CTFDosControlTestCase( void ); |
|
50 |
|
51 private: |
|
52 CTFDosControlTestCase( const CTFDosControlTestCase& aStub ); |
|
53 CTFDosControlTestCase& operator=( const CTFDosControlTestCase& aStub ); |
|
54 |
|
55 public: |
|
56 void NotifyDosEvent( TInt aEvent, TInt aParameter ); |
|
57 |
|
58 public: |
|
59 void ActiveTestRunL( void ); |
|
60 |
|
61 protected: |
|
62 void Log( TInt aDepth ); |
|
63 void InitL( void ); |
|
64 void RunL( void ); |
|
65 void Teardown( void ); |
|
66 |
|
67 protected: |
|
68 void DoCompleteTest( TInt aResult ); |
|
69 void StartNextState( TInt aResult ); |
|
70 void CallCurrentDosFunctionL( void ); |
|
71 TInt CurrentStateIndex( void ) const; |
|
72 CTFDosControlTestCaseParam& Parameters( void ); |
|
73 TTFDosFunction CurrentDosFunction( void ) const; |
|
74 TInt CurrentArg1( void ) const; |
|
75 CTFATestTimer* Timer( void ); |
|
76 |
|
77 private: |
|
78 TInt CheckResult( TInt aResult ); |
|
79 |
|
80 private: |
|
81 CTFDosControlTestCaseParam* iParameters; |
|
82 TTFDosServerControlTestCaseState iCurrentState; |
|
83 TInt iCurrentStateIndex; |
|
84 CTFATestTimer* iTimer; |
|
85 TBool iCleanupWait; |
|
86 TInt iStoredArg1; |
|
87 TInt iStoredArg2; |
|
88 }; |
|
89 |
|
90 #endif |