os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0497.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 #ifndef __TEST_CASE_PBASE_T_USBDI_0497_H
     2 #define __TEST_CASE_PBASE_T_USBDI_0497_H
     3 
     4 /*
     5 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     6 * All rights reserved.
     7 * This component and the accompanying materials are made available
     8 * under the terms of the License "Eclipse Public License v1.0"
     9 * which accompanies this distribution, and is available
    10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 *
    12 * Initial Contributors:
    13 * Nokia Corporation - initial contribution.
    14 *
    15 * Contributors:
    16 *
    17 * Description:
    18 * @file PBASE-T_USBDI-0497.h
    19 * @internalComponent
    20 * 
    21 *
    22 */
    23 
    24 
    25 
    26  
    27 #include "BaseBulkTestCase.h"
    28 
    29 
    30 namespace NUnitTesting_USBDI
    31 	{
    32 	const TUint8 KNumOutTransfersPerInterface		= 2; //number of queued OUT transfers in used for each interface
    33 	const TUint8 KNumInTransfersPerInterface		= 2; //number of queued IN transfers used for each interface
    34 
    35 /**
    36 
    37 	
    38 	@SYMTestCaseID				PBASE-T_USBDI-0497
    39 	@SYMTestCaseDesc			Test use of multiple bulk transfers doing a round trip on two interfaces
    40 	@SYMFssID 
    41 	@SYMPREQ					1305
    42 	@SYMREQ						7055 [USBD : Bulk transfers]
    43 	@SYMTestType				UT
    44 	@SYMTestPriority			1 
    45 	@SYMTestActions 			1. Open interfaces to connected device
    46 								2. Queue two bulk OUT transfer requests on each interface
    47 								3. On completion of OUT transfers queue two bulk IN transfer requests on each interface
    48 								4. Validate round trip data
    49 								5. Compare completion times for each bulk transfer
    50 	@SYMTestExpectedResults 	Round trip transfer data is not corrupt
    51 	@SYMTestStatus				Draft
    52 	
    53 
    54 */
    55 
    56 class CUT_PBASE_T_USBDI_0497 :  public CBaseBulkTestCase,
    57 								public MTransferObserver,
    58 								public MCommandObserver
    59 	
    60 	{
    61 public:
    62 	static CUT_PBASE_T_USBDI_0497* NewL(TBool aHostRole);
    63 	~CUT_PBASE_T_USBDI_0497(); 
    64 
    65 public: // From MUsbBusObserver
    66 	void DeviceInsertedL(TUint aDeviceHandle);
    67 
    68 public: // From MCommandObserver
    69 	void Ep0TransferCompleteL(TInt aCompletionCode);
    70 
    71 public: // From MTransferObserver
    72 	void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
    73 
    74 private:
    75 	CUT_PBASE_T_USBDI_0497(TBool aHostRole);
    76 	void ConstructL();
    77 
    78 private:
    79 	
    80 	enum TCaseStep
    81 		{
    82 		EInProgress,
    83 		EPassed,
    84 		EFailed,
    85 		ERequestDeviceRead,
    86 		ETransferOut,
    87 		ERequestDeviceWriteBack,
    88 		ETransferIn
    89 		};
    90 
    91 		// Transfer objects - use specific names for this test
    92 		CBulkTransfer* iIfc1InTransfer[KNumInTransfersPerInterface];
    93 		CBulkTransfer* iIfc1OutTransfer[KNumOutTransfersPerInterface];
    94 		
    95 		CBulkTransfer* iIfc2InTransfer[KNumInTransfersPerInterface];
    96 		CBulkTransfer* iIfc2OutTransfer[KNumOutTransfersPerInterface];
    97 		
    98 		TCaseStep iCaseStep;
    99 
   100 private:
   101 	/**
   102 	The functor for this test case
   103 	*/
   104 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0497,TBool> iFunctor;
   105 	};
   106 
   107 	} //end namespace
   108 
   109 #endif