os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/exampletestcase.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2007-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 "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 // @internalComponent
    15 // 
    16 //
    17 
    18 #ifndef EXAMPLETESTCASE_H
    19 #define EXAMPLETESTCASE_H
    20 
    21 
    22 	
    23 /**	
    24 	@SYMTestCaseID				EXAMPLETESTCASE
    25 	@SYMTestCaseDesc			Description - shows various test-framework features
    26 	@SYMFssID 					none
    27 	@SYMPREQ					preq#
    28 	@SYMREQ						n/a
    29 	@SYMTestType				UT
    30 	@SYMTestPriority			1 
    31 	@SYMTestActions 			1. Empty step
    32 								2. Press any key step (with watchdog)
    33 								3. Another press key step (with watchdog)
    34 								4. Watchdog cancel function works
    35 								5. delay step
    36 								6. Empty step
    37 								7. End the test
    38 	@SYMTestExpectedResults 	Example
    39 	@SYMTestStatus				Proto
    40 	
    41 */
    42 	
    43 // Example test case:
    44 // Something to test the Engine with if ever it changes. Verify development changes, and 
    45 // new test-case creation steps here.
    46 class CExampleTestCase : public CTestCaseRoot
    47 	{
    48 public:
    49 	static CExampleTestCase* NewL(TBool aHost);
    50 	virtual ~CExampleTestCase();
    51 
    52 	void WatchdogExpired();
    53 
    54 	virtual void ExecuteTestCaseL();
    55 	void DoCancel();
    56 	void RunStepL();
    57 	
    58 	//override the base-class
    59 	void ProcessKey(TKeyCode &aKey);
    60 	TInt GetStepIndex()	{ return(iCaseStep); };
    61 		
    62 	virtual void DescribePreconditions();
    63 	
    64 private:
    65 	CExampleTestCase(TBool aHost);
    66 	void ConstructL();
    67 
    68 	
    69 	CTestCaseWatchdog *iWDTimer;
    70 	
    71 	// cancel callback methods (not implemented as a 'Mixin)
    72 	static void FuncA(CTestCaseRoot *pThis);
    73 	static void FuncB(CTestCaseRoot *pThis);
    74 	static void FuncC(CTestCaseRoot *pThis);
    75 	
    76 private:
    77 
    78 	enum TCaseSteps
    79 		{
    80 		EFirstStep,
    81 		ESecondStep,
    82 		EThirdStep,
    83 		EFourthStep,
    84 		EFifthStep,
    85 		ESixthStep,
    86 		ELastStep	
    87 		};
    88 	
    89 	TCaseSteps iCaseStep;
    90 	
    91 	const static TTestCaseFactoryReceipt<CExampleTestCase> iFactoryReceipt;
    92 	
    93 	
    94 	};
    95 	
    96 	
    97 #endif // EXAMPLETESTCASE_H