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

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

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