未验证 提交 18834d06 编写于 作者: O openharmony_ci 提交者: Gitee

!4155 【xts_acts】【OpenHarmony-3.1-Release】参数target覆盖,注释修改

Merge pull request !4155 from 李晓枫/lxf0706_Release
...@@ -15,17 +15,18 @@ ...@@ -15,17 +15,18 @@
/* host test case */ /* host test case */
//require('./UsbCoreJsunit.test.js') // require('./UsbCoreJsunit.test.js')
//require('./UsbCoreJsunitEx.test.js') // require('./UsbCoreJsunitEx.test.js')
//require('./UsbDevicePipeJsunit.test.js') // require('./UsbDevicePipeJsunit.test.js')
//require('./UsbDevicePipeJsunitEx.test.js') // require('./UsbDevicePipeJsunitEx.test.js')
// require('./UsbDevicePipeJsunit_A.test.js')
/* device test case */ /* device test case */
//require('./UsbFunctionsJsunit.test.js') // require('./UsbFunctionsJsunit.test.js')
//require('./UsbFunctionsJsunitEx.test.js') // require('./UsbFunctionsJsunitEx.test.js')
/* device and host test case */ /* device and host test case */
//require('./UsbPortJsunit.test.js') // require('./UsbPortJsunit.test.js')
//require('./UsbPortJsunitEx.test.js') // require('./UsbPortJsunitEx.test.js')
require('./UsbAutoJsunit.test.js') require('./UsbAutoJsunit.test.js')
...@@ -236,14 +236,16 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -236,14 +236,16 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
expect(true).assertTrue(); expect(true).assertTrue();
}) })
function getTransferParam(iCmd, iReqType, iValue, iIndex) { function getTransferParam(iCmd, iReqTarType, iReqType, iValue, iIndex) {
var tmpUint8Array = new Uint8Array(512); var tmpUint8Array = new Uint8Array(512);
var requestCmd = iCmd var requestCmd = iCmd
var requestTargetType = iReqTarType
var requestType = iReqType var requestType = iReqType
var value = iValue; var value = iValue;
var index = iIndex; var index = iIndex;
var controlParam = { var controlParam = {
request: requestCmd, request: requestCmd,
target: requestTargetType,
reqType: requestType, reqType: requestType,
value: value, value: value,
index: index, index: index,
...@@ -383,7 +385,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -383,7 +385,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(6, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7) var controlParam = getTransferParam(6, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), (2 << 8), 0) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_01 GetDescriptor') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_01 GetDescriptor')
}) })
...@@ -402,7 +404,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -402,7 +404,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(0, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7) var controlParam = getTransferParam(0, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_02 GetStatus') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_02 GetStatus')
}) })
...@@ -421,7 +423,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -421,7 +423,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(8, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7) var controlParam = getTransferParam(8, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_03 GetConfiguration') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_03 GetConfiguration')
}) })
...@@ -429,7 +431,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -429,7 +431,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_04 * @tc.number : SUB_USB_control_transfer_test_04
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 GetInterface: cmd 10 reqType 129 value 0 index 1 * @tc.desc : 控制传输 GetInterface: cmd 8 reqType 129 value 0 index 1
*/ */
it('SUB_USB_control_transfer_test_04', 0, function () { it('SUB_USB_control_transfer_test_04', 0, function () {
console.info('usb control_transfer_test_04 begin'); console.info('usb control_transfer_test_04 begin');
...@@ -440,7 +442,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -440,7 +442,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(10, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7) var controlParam = getTransferParam(10, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), 0, 1) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), 0, 1)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_04 GetInterface') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_04 GetInterface')
}) })
...@@ -459,7 +461,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -459,7 +461,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(1, (usb.USB_REQUEST_DIR_TO_DEVICE << 7) var controlParam = getTransferParam(1, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_05 ClearFeature') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_05 ClearFeature')
}) })
...@@ -467,7 +469,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -467,7 +469,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_06 * @tc.number : SUB_USB_control_transfer_test_06
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 129 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_06', 0, function () { it('SUB_USB_control_transfer_test_06', 0, function () {
console.info('usb control_transfer_test_06 begin'); console.info('usb control_transfer_test_06 begin');
...@@ -478,7 +480,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -478,7 +480,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7) var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), (2 << 8), 0) | (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_06 ClearFeature') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_06 ClearFeature')
}) })
...@@ -486,7 +488,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -486,7 +488,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_07 * @tc.number : SUB_USB_control_transfer_test_07
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 3 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_07', 0, function () { it('SUB_USB_control_transfer_test_07', 0, function () {
console.info('usb control_transfer_test_07 begin'); console.info('usb control_transfer_test_07 begin');
...@@ -497,7 +499,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -497,7 +499,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7) var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_ENDPOINT, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_ENDPOINT & 0x1f), (2 << 8), 0) | (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_ENDPOINT & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_07 ClearFeature') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_07 ClearFeature')
}) })
...@@ -505,7 +507,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -505,7 +507,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_08 * @tc.number : SUB_USB_control_transfer_test_08
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 5 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_08', 0, function () { it('SUB_USB_control_transfer_test_08', 0, function () {
console.info('usb control_transfer_test_08 begin'); console.info('usb control_transfer_test_08 begin');
...@@ -516,7 +518,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -516,7 +518,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7) var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_VENDOR << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), (2 << 8), 0) | (usb.USB_REQUEST_TYPE_VENDOR << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_08 ClearFeature') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_08 ClearFeature')
}) })
...@@ -524,7 +526,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -524,7 +526,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_09 * @tc.number : SUB_USB_control_transfer_test_09
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 4 value 0 index 0
*/ */
it('SUB_USB_control_transfer_test_09', 0, function () { it('SUB_USB_control_transfer_test_09', 0, function () {
console.info('usb control_transfer_test_09 begin'); console.info('usb control_transfer_test_09 begin');
...@@ -535,7 +537,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -535,7 +537,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
} }
var timeout = 5000; var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7) var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), 0, 0) | (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_09 ClearFeature') callControlTransfer(testParam.pip, controlParam, timeout, 'control_transfer_test_09 ClearFeature')
}) })
......
...@@ -20,12 +20,12 @@ import parameter from '@ohos.systemparameter'; ...@@ -20,12 +20,12 @@ import parameter from '@ohos.systemparameter';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
/* usb device pipe test */ /* usb device pipe test */
describe('UsbDevicePipeJsFunctionsTest', function () { describe('UsbDevicePipeJsFunctionsTestA', function () {
var gDeviceList var gDeviceList
var gPipe var gPipe
beforeAll(function () { beforeAll(function () {
console.log('*************Usb Unit UsbDevicePipeJsFunctionsTest Begin*************'); console.log('*************Usb Unit UsbDevicePipeJsFunctionsTestA Begin*************');
var Version = usb.getVersion() var Version = usb.getVersion()
console.info('usb unit begin test getversion :' + Version) console.info('usb unit begin test getversion :' + Version)
// version > 17 host currentMode = 2 device currentMode = 1 // version > 17 host currentMode = 2 device currentMode = 1
...@@ -59,7 +59,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -59,7 +59,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
afterAll(function () { afterAll(function () {
var isPipClose = usb.closePipe(gPipe) var isPipClose = usb.closePipe(gPipe)
console.info('usb unit close gPipe ret : ' + isPipClose); console.info('usb unit close gPipe ret : ' + isPipClose);
console.log('*************Usb Unit UsbDevicePipeJsFunctionsTest End*************'); console.log('*************Usb Unit UsbDevicePipeJsFunctionsTestA End*************');
}) })
function findInitPoint(testParam, j) { function findInitPoint(testParam, j) {
...@@ -445,7 +445,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -445,7 +445,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_04 * @tc.number : SUB_USB_control_transfer_test_04
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 GetInterface: cmd 10 reqType 129 value 0 index 1 * @tc.desc : 控制传输 GetInterface: cmd 8 reqType 129 value 0 index 1
*/ */
it('SUB_USB_control_transfer_test_04', 0, function () { it('SUB_USB_control_transfer_test_04', 0, function () {
console.info('usb control_transfer_test_04 begin'); console.info('usb control_transfer_test_04 begin');
...@@ -483,7 +483,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -483,7 +483,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_06 * @tc.number : SUB_USB_control_transfer_test_06
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 129 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_06', 0, function () { it('SUB_USB_control_transfer_test_06', 0, function () {
console.info('usb control_transfer_test_06 begin'); console.info('usb control_transfer_test_06 begin');
...@@ -502,7 +502,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -502,7 +502,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_07 * @tc.number : SUB_USB_control_transfer_test_07
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 3 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_07', 0, function () { it('SUB_USB_control_transfer_test_07', 0, function () {
console.info('usb control_transfer_test_07 begin'); console.info('usb control_transfer_test_07 begin');
...@@ -521,7 +521,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -521,7 +521,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_08 * @tc.number : SUB_USB_control_transfer_test_08
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 5 value 512 index 0
*/ */
it('SUB_USB_control_transfer_test_08', 0, function () { it('SUB_USB_control_transfer_test_08', 0, function () {
console.info('usb control_transfer_test_08 begin'); console.info('usb control_transfer_test_08 begin');
...@@ -540,7 +540,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -540,7 +540,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
/** /**
* @tc.number : SUB_USB_control_transfer_test_09 * @tc.number : SUB_USB_control_transfer_test_09
* @tc.name : controlTransfer * @tc.name : controlTransfer
* @tc.desc : 控制传输 ClearFeature: cmd 1 reqType 0 value 0 index 0 * @tc.desc : 控制传输 ClearFeature: cmd 255 reqType 4 value 0 index 0
*/ */
it('SUB_USB_control_transfer_test_09', 0, function () { it('SUB_USB_control_transfer_test_09', 0, function () {
console.info('usb control_transfer_test_09 begin'); console.info('usb control_transfer_test_09 begin');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册