Skip to content
代码片段 群组 项目
未验证 提交 e9aed759 编辑于 作者: paulr34's avatar paulr34 提交者: GitHub
浏览文件

fix helper to return Integer Array and set default to 0 + fix tests (#1262)

上级 28cb71b2
No related branches found
No related tags found
无相关合并请求
......@@ -94,7 +94,7 @@ function endpoint_fixed_profile_id_array(options) {
}
/**
* Creates array of parent endpoint identifier fields on endpoints with a NULL placeholder for Endpoints without a Parent Endpoint configuration
* Creates Integer Array of parent endpoint identifier fields on endpoints. If the Parent Endpoint is not set then it will default to 0.
*
*
* @returns C array including the { } brackets
......@@ -103,7 +103,7 @@ function endpoint_fixed_parent_id_array(options) {
let parentIds = []
this.endpoints.forEach((ep) => {
if (ep.parentEndpointIdentifier == null) {
parentIds.push('NULL')
parentIds.push(0)
} else {
parentIds.push(ep.parentEndpointIdentifier)
}
......
......@@ -158,7 +158,7 @@ test(
expect(ept).toContain(
'#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }'
)
expect(ept).toContain('#define FIXED_PARENT_IDS { NULL, 0, 1, NULL }')
expect(ept).toContain('#define FIXED_PARENT_IDS { 0, 0, 1, 0 }')
expect(ept).toContain(
'#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}'
)
......@@ -265,7 +265,7 @@ test(
expect(ept).toContain(
'#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }'
)
expect(ept).toContain('#define FIXED_PARENT_IDS { NULL, NULL, NULL, NULL }')
expect(ept).toContain('#define FIXED_PARENT_IDS { 0, 0, 0, 0 }')
expect(ept).toContain(
'#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}'
)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册