os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 // @file PBASE-T_USBDI-0476.cpp
    15 // @internalComponent
    16 // 
    17 //
    18 
    19 #include "PBASE-T_USBDI-0476.h"
    20 #include "descriptorsRawData.h"
    21 #include <d32usbdescriptors.h>
    22 #include "testpolicy.h"
    23 
    24 namespace NUnitTesting_USBDI
    25 	{
    26 	
    27 _LIT(KTestCaseId,"PBASE-T_USBDI-0476");
    28 const TFunctorTestCase<CUT_PBASE_T_USBDI_0476,TBool> CUT_PBASE_T_USBDI_0476::iFunctor(KTestCaseId);	
    29 
    30 CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole)
    31 	{
    32 	CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole);
    33 	CleanupStack::PushL(self);
    34 	self->ConstructL();
    35 	CleanupStack::Pop(self);
    36 	return self;
    37 	}
    38 	
    39 
    40 CUT_PBASE_T_USBDI_0476::CUT_PBASE_T_USBDI_0476(TBool aHostRole)
    41 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
    42 	iCaseStep(EInProgress)
    43 	{
    44 	} 
    45 
    46 
    47 void CUT_PBASE_T_USBDI_0476::ConstructL()
    48 	{
    49 	LOG_FUNC
    50 	}
    51 
    52 
    53 CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476()
    54 	{
    55 	LOG_FUNC
    56 	
    57 	Cancel();
    58 	}
    59 	
    60 
    61 			
    62 void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL()	
    63 	{
    64 	LOG_FUNC
    65 	TInt err(KErrNone);
    66 	
    67 	TUsbGenericDescriptor* parsed = NULL;
    68 	TUsbDeviceDescriptor* devDesc = 0;
    69 
    70 	// Parse Device Descriptor
    71 	err	= UsbDescriptorParser::Parse(KDeviceDescriptorData, parsed);
    72 	CHECK(err == KErrNone) // KErrNone
    73 	devDesc = TUsbDeviceDescriptor::Cast(parsed);
    74 	CHECK(devDesc != 0)	
    75 	CHECK(err == KErrNone) // KErrNone
    76 	
    77 	// Parse Configuration Descriptor ---------- Case 1
    78 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase1, 1) == KErrNone);	
    79 	
    80 	// Parse Configuration Descriptor ---------- Case 2
    81 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase2, 2) == KErrNone);
    82 	
    83 	// Parse Configuration Descriptor ---------- Case 3
    84 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase3, 3) == KErrNone);
    85 	
    86 	// Parse Configuration Descriptor ---------- Case 4
    87 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KBtDongleDescriptorTestCase4			 , 4) == KErrGeneral);
    88 	
    89 	// Parse Configuration Descriptor ---------- Case 5
    90 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase5, 5) == KErrNone);
    91 	
    92 	// Parse Configuration Descriptor ---------- Case 6
    93 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase6, 6) == KErrNone);
    94 	
    95 	// Parse Configuration Descriptor ---------- Case 7
    96 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase7, 7) == KErrNone);
    97 	
    98 	// Parse Configuration Descriptor ---------- Case 8
    99 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase8, 8) == KErrNone);
   100 	
   101 	// Parse Configuration Descriptor ---------- Case 9
   102 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase9, 9) == KErrNone);
   103 	
   104 	// Parse Configuration Descriptor ---------- Case 10
   105 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase10, 10) == KErrNone);
   106 	
   107 	// Parse Configuration Descriptor ---------- Case 11
   108 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase11, 11) == KErrNone);
   109 	
   110 	// Parse Configuration Descriptor ---------- Case 12
   111 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase12, 12) == KErrNone);
   112 	
   113 	// Parse Configuration Descriptor ---------- Case 13
   114 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase13, 13) == KErrNone);
   115 	
   116 	// Parse Configuration Descriptor ---------- Case 14
   117 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone);
   118 	
   119 	TestPassed();
   120 	}   
   121 	
   122 void CUT_PBASE_T_USBDI_0476::HostDoCancel()
   123 	{
   124 	LOG_FUNC	
   125 	}
   126 	
   127 	
   128 void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL()	
   129 	{	
   130 	}	
   131 	
   132 void CUT_PBASE_T_USBDI_0476::DeviceDoCancel()
   133 	{
   134 	LOG_FUNC
   135 	}
   136 
   137 
   138 void CUT_PBASE_T_USBDI_0476::HostRunL()
   139 	{
   140 	LOG_FUNC
   141 	}
   142 
   143 
   144 void CUT_PBASE_T_USBDI_0476::DeviceRunL()
   145 	{	
   146 	LOG_FUNC
   147 	}
   148 
   149 	
   150 	}