os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-1230.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_1230_H
     2 #define __TEST_CASE_PBASE_T_USBDI_1230_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-1230.h
    19 * @internalComponent
    20 * 
    21 *
    22 */
    23 
    24 
    25 
    26  
    27 #include "BaseBulkTestCase.h"
    28 
    29 
    30 namespace NUnitTesting_USBDI
    31 	{
    32 const TUint8 KNumInitialRequests	= 4;
    33 /**
    34 
    35 	
    36 	@SYMTestCaseID				PBASE-T_USBDI-1230
    37 	@SYMTestCaseDesc			Test use of two queued bulk IN transfers to read a large amount of data working together another type of transfer
    38 	@SYMFssID 
    39 	@SYMPREQ					1305
    40 	@SYMREQ						7055 [USBD : Bulk transfers]
    41 	@SYMTestType				UT
    42 	@SYMTestPriority			1 
    43 	@SYMTestActions 			1. Open interfaces to connected device
    44 								2. Request two bulk IN transfers
    45 								3. When each completes request another one until specified number of bytes have been read
    46 								4. Whilst bulk transfers are active, send EP0 transfers and check they have priority over bulk transfers
    47 								5. Validate data as it is read
    48 	@SYMTestExpectedResults 	Round trip transfer data is not corrupt
    49 	@SYMTestStatus				Draft
    50 	
    51 	
    52 
    53 */
    54 
    55 class CUT_PBASE_T_USBDI_1230 :  public CBaseBulkTestCase,
    56 								public MTransferObserver,
    57 								public MCommandObserver
    58 	
    59 	{
    60 public:
    61 	static CUT_PBASE_T_USBDI_1230* NewL(TBool aHostRole);
    62 	~CUT_PBASE_T_USBDI_1230(); 
    63 
    64 public: // From MUsbBusObserver
    65 	void DeviceInsertedL(TUint aDeviceHandle);
    66 
    67 public: // From MCommandObserver
    68 	void Ep0TransferCompleteL(TInt aCompletionCode);
    69 
    70 public: // From MTransferObserver
    71 	void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
    72 	void HandleBulkTestTimerFired();
    73 
    74 private:
    75 	CUT_PBASE_T_USBDI_1230(TBool aHostRole);
    76 	void ConstructL();
    77 	void KillTransfers();
    78 	void ExtractDeviceReadBytes();
    79 	void PostTransferAction();
    80 	TInt ValidatePreviousAndPerformNextTransfers(TInt aTransferId);
    81 	void RequestNumBytesSent(TUint8 aTimerIndex);
    82 
    83 private:
    84 	
    85 	enum TCaseStep
    86 		{
    87 		EInProgress,
    88 		EPassed,
    89 		EFailed,
    90 		EGetTimerBase,
    91 		ERequestRepeatedWrite,
    92 		ETransfer,
    93 		EDelayedTransferComplete
    94 		};
    95 
    96 		TUint iDeviceNumBytesReadInTotal;
    97 		TUint iDeviceMinTimedNumBytesRead;
    98 		TUint iDeviceMaxTimedNumBytesRead;
    99 
   100 		TUint iNumBytesExpected[KMaxNumInTransfers];
   101 		TUint iValidationStringStartPointTransfer[KMaxNumInTransfers];
   102 		TInt iExpectedNextTransferNumber;
   103 		TUint iNumBytesRequestedSoFar;
   104 		TBool iIsValid;
   105 		TBool iIsTransferError;
   106 		TCaseStep iCaseStep;
   107 		TInt iCountWaitForRequestShortfall;
   108 
   109 private:
   110 	/**
   111 	The functor for this test case
   112 	*/
   113 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_1230,TBool> iFunctor;
   114 	};
   115 
   116 	} //end namespace
   117 
   118 #endif