kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 
    18 
    19 #include "PBASE-T_USBDI-0475.h"
    19 #include "PBASE-T_USBDI-0475.h"
    20 #include "descriptorsRawData.h"
    20 #include "descriptorsRawData.h"
    21 #include <d32usbdescriptors.h>
    21 #include <d32usbdescriptors.h>
    22 #include "testpolicy.h"
    22 #include "testpolicy.h"
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "PBASE-T_USBDI-0475Traces.h"
       
    26 #endif
       
    27 
       
    28 
       
    29 
    23 
    30 namespace NUnitTesting_USBDI
    24 namespace NUnitTesting_USBDI
    31 	{
    25 	{
    32 	
    26 	
    33 _LIT(KTestCaseId,"PBASE-T_USBDI-0475");
    27 _LIT(KTestCaseId,"PBASE-T_USBDI-0475");
    34 const TFunctorTestCase<CUT_PBASE_T_USBDI_0475,TBool> CUT_PBASE_T_USBDI_0475::iFunctor(KTestCaseId);	
    28 const TFunctorTestCase<CUT_PBASE_T_USBDI_0475,TBool> CUT_PBASE_T_USBDI_0475::iFunctor(KTestCaseId);	
    35 
    29 
    36 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
    30 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
    37 	{
    31 	{
    38 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_NEWL_ENTRY, aHostRole );
       
    39 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
    32 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
    40 	CleanupStack::PushL(self);
    33 	CleanupStack::PushL(self);
    41 	self->ConstructL();
    34 	self->ConstructL();
    42 	CleanupStack::Pop(self);
    35 	CleanupStack::Pop(self);
    43 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_NEWL_EXIT, ( TUint )( self ) );
       
    44 	return self;
    36 	return self;
    45 	}
    37 	}
    46 	
    38 	
    47 
    39 
    48 CUT_PBASE_T_USBDI_0475::CUT_PBASE_T_USBDI_0475(TBool aHostRole)
    40 CUT_PBASE_T_USBDI_0475::CUT_PBASE_T_USBDI_0475(TBool aHostRole)
    49 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
    41 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
    50 	iCaseStep(EInProgress)
    42 	iCaseStep(EInProgress)
    51 	{
    43 	{
    52 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY, this );
       
    53 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT, this );
       
    54 	} 
    44 	} 
    55 
    45 
    56 
    46 
    57 void CUT_PBASE_T_USBDI_0475::ConstructL()
    47 void CUT_PBASE_T_USBDI_0475::ConstructL()
    58 	{
    48 	{
    59 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY, this );
    49 	LOG_FUNC
    60 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT, this );
       
    61 	}
    50 	}
    62 
    51 
    63 
    52 
    64 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
    53 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
    65 	{
    54 	{
    66 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01, this );
    55 	LOG_FUNC
    67 	
    56 	
    68 	Cancel();
    57 	Cancel();
    69 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01, this );
       
    70 	}
    58 	}
    71 	
    59 	
    72 	
    60 	
    73 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
    61 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
    74 	{	
    62 	{	
    75 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY, this );
    63 	LOG_FUNC
    76 	TInt err(KErrNone);
    64 	TInt err(KErrNone);
    77 	
    65 	
    78 	TUsbGenericDescriptor* parsed = NULL;
    66 	TUsbGenericDescriptor* parsed = NULL;
    79 	TUsbDeviceDescriptor* devDesc = 0;
    67 	TUsbDeviceDescriptor* devDesc = 0;
    80 	TUsbConfigurationDescriptor* configDesc = 0;
    68 	TUsbConfigurationDescriptor* configDesc = 0;
   102 	
    90 	
   103 	// Parse Configuration Descriptor ---------- Case 3
    91 	// Parse Configuration Descriptor ---------- Case 3
   104 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
    92 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
   105 
    93 
   106 	TestPassed();	
    94 	TestPassed();	
   107 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT, this );
       
   108 	}   
    95 	}   
   109 	
    96 	
   110 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
    97 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
   111 	{
    98 	{
   112 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY, this );
    99 	LOG_FUNC	
   113 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT, this );
       
   114 	}
   100 	}
   115 	
   101 	
   116 	
   102 	
   117 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
   103 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
   118 	{	
   104 	{	
   119 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY, this );
       
   120 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT, this );
       
   121 	}	
   105 	}	
   122 	
   106 	
   123 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
   107 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
   124 	{
   108 	{
   125 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY, this );
   109 	LOG_FUNC
   126 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT, this );
       
   127 	}	
   110 	}	
   128 
   111 
   129 
   112 
   130 
   113 
   131 void CUT_PBASE_T_USBDI_0475::HostRunL()
   114 void CUT_PBASE_T_USBDI_0475::HostRunL()
   132 	{
   115 	{
   133 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY, this );
   116 	LOG_FUNC
   134 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT, this );
       
   135 	}
   117 	}
   136 
   118 
   137 
   119 
   138 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
   120 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
   139 	{	
   121 	{	
   140 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY, this );
   122 	LOG_FUNC
   141 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT, this );
       
   142 	}
   123 	}
   143 
   124 
   144 	
   125 	
   145 	}
   126 	}