kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp
changeset 259 57b9594f5772
parent 0 a41df078684a
child 257 3e88ff8f41d5
child 271 dc268b18d709
equal deleted inserted replaced
247:d8d70de2bd36 259:57b9594f5772
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2010 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 
    23 
    29 
    24 namespace NUnitTesting_USBDI
    30 namespace NUnitTesting_USBDI
    25 	{
    31 	{
    26 	
    32 	
    27 _LIT(KTestCaseId,"PBASE-T_USBDI-0475");
    33 _LIT(KTestCaseId,"PBASE-T_USBDI-0475");
    28 const TFunctorTestCase<CUT_PBASE_T_USBDI_0475,TBool> CUT_PBASE_T_USBDI_0475::iFunctor(KTestCaseId);	
    34 const TFunctorTestCase<CUT_PBASE_T_USBDI_0475,TBool> CUT_PBASE_T_USBDI_0475::iFunctor(KTestCaseId);	
    29 
    35 
    30 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
    36 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
    31 	{
    37 	{
       
    38 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_NEWL_ENTRY, aHostRole );
    32 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
    39 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
    33 	CleanupStack::PushL(self);
    40 	CleanupStack::PushL(self);
    34 	self->ConstructL();
    41 	self->ConstructL();
    35 	CleanupStack::Pop(self);
    42 	CleanupStack::Pop(self);
       
    43 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_NEWL_EXIT, ( TUint )( self ) );
    36 	return self;
    44 	return self;
    37 	}
    45 	}
    38 	
    46 	
    39 
    47 
    40 CUT_PBASE_T_USBDI_0475::CUT_PBASE_T_USBDI_0475(TBool aHostRole)
    48 CUT_PBASE_T_USBDI_0475::CUT_PBASE_T_USBDI_0475(TBool aHostRole)
    41 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
    49 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
    42 	iCaseStep(EInProgress)
    50 	iCaseStep(EInProgress)
    43 	{
    51 	{
       
    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 );
    44 	} 
    54 	} 
    45 
    55 
    46 
    56 
    47 void CUT_PBASE_T_USBDI_0475::ConstructL()
    57 void CUT_PBASE_T_USBDI_0475::ConstructL()
    48 	{
    58 	{
    49 	LOG_FUNC
    59 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY, this );
       
    60 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT, this );
    50 	}
    61 	}
    51 
    62 
    52 
    63 
    53 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
    64 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
    54 	{
    65 	{
    55 	LOG_FUNC
    66 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01, this );
    56 	
    67 	
    57 	Cancel();
    68 	Cancel();
       
    69 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01, this );
    58 	}
    70 	}
    59 	
    71 	
    60 	
    72 	
    61 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
    73 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
    62 	{	
    74 	{	
    63 	LOG_FUNC
    75 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY, this );
    64 	TInt err(KErrNone);
    76 	TInt err(KErrNone);
    65 	
    77 	
    66 	TUsbGenericDescriptor* parsed = NULL;
    78 	TUsbGenericDescriptor* parsed = NULL;
    67 	TUsbDeviceDescriptor* devDesc = 0;
    79 	TUsbDeviceDescriptor* devDesc = 0;
    68 	TUsbConfigurationDescriptor* configDesc = 0;
    80 	TUsbConfigurationDescriptor* configDesc = 0;
    90 	
   102 	
    91 	// Parse Configuration Descriptor ---------- Case 3
   103 	// Parse Configuration Descriptor ---------- Case 3
    92 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
   104 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
    93 
   105 
    94 	TestPassed();	
   106 	TestPassed();	
       
   107 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT, this );
    95 	}   
   108 	}   
    96 	
   109 	
    97 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
   110 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
    98 	{
   111 	{
    99 	LOG_FUNC	
   112 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY, this );
       
   113 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT, this );
   100 	}
   114 	}
   101 	
   115 	
   102 	
   116 	
   103 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
   117 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
   104 	{	
   118 	{	
       
   119 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY, this );
       
   120 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT, this );
   105 	}	
   121 	}	
   106 	
   122 	
   107 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
   123 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
   108 	{
   124 	{
   109 	LOG_FUNC
   125 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY, this );
       
   126 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT, this );
   110 	}	
   127 	}	
   111 
   128 
   112 
   129 
   113 
   130 
   114 void CUT_PBASE_T_USBDI_0475::HostRunL()
   131 void CUT_PBASE_T_USBDI_0475::HostRunL()
   115 	{
   132 	{
   116 	LOG_FUNC
   133 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY, this );
       
   134 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT, this );
   117 	}
   135 	}
   118 
   136 
   119 
   137 
   120 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
   138 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
   121 	{	
   139 	{	
   122 	LOG_FUNC
   140 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY, this );
       
   141 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT, this );
   123 	}
   142 	}
   124 
   143 
   125 	
   144 	
   126 	}
   145 	}