Skip to content
代码片段 群组 项目
提交 4043c97f 编辑于 作者: Bharat Dandu's avatar Bharat Dandu 提交者: Bharat Raju
浏览文件

Adding tests for custom xml removal in the case of cluster extensions for standard clusters

Github: ZAP#698
上级 615ca9d5
No related branches found
No related tags found
无相关合并请求
......@@ -324,6 +324,11 @@ test(
expect(commands).toContain('#define emberAfFillCommandCustomClusterC13')
expect(commands).toContain('ZCL_C13_COMMAND_ID')
// Test custom command coming from standard cluster extensions(identify cluster extension)
expect(commands).toContain(
'#define emberAfFillCommandIdentifyClusterSampleMfgSpecificIdentifyCommand1'
)
// Test command structs genereted
let structs = genResult.content['zap-command-structs.h']
expect(structs).toContain(
......@@ -336,6 +341,37 @@ test(
expect(ids).toContain('#define ZCL_C15_COMMAND_ID (0x03)')
expect(ids).toContain('#define ZCL_A8_ATTRIBUTE_ID (0x0301)')
expect(ids).toContain('#define ZCL_C11_COMMAND_ID (0x0A)')
// Test custom attributes coming from standard cluster extensions(identify cluster extension)
expect(ids).toContain(
'#define ZCL_SAMPLE_MFG_SPECIFIC_IDENTIFY_1_ATTRIBUTE_ID (0x0000)'
)
// Delete the custom xml packageId from the existing session and test generation again
await queryPackage.deleteSessionPackage(db, sessionId, result.packageId)
// Generate again after removing a custom xml file
genResult = await genEngine.generate(
db,
sessionId,
templateContext.packageId,
{},
{
disableDeprecationWarnings: true,
}
)
ids = genResult.content['zap-id.h']
commands = genResult.content['zap-command-ver-2.h']
// Test custom attributes removal coming from standard cluster extensions(identify cluster extension)
expect(ids).not.toContain(
'#define ZCL_SAMPLE_MFG_SPECIFIC_IDENTIFY_1_ATTRIBUTE_ID (0x0000)'
)
// Test custom command removal coming from standard cluster extensions(identify cluster extension)
expect(commands).not.toContain(
'#define emberAfFillCommandIdentifyClusterSampleMfgSpecificIdentifyCommand1'
)
},
testUtil.timeout.long()
)
......@@ -293,4 +293,15 @@
<arg name="arg3" type="INT32S" />
</command>
</cluster>
<!-- Use the cluster extension to extend the identify cluster(Standard Cluster) -->
<clusterExtension code="0x0003">
<attribute side="server" code="0x0000" define="SAMPLE_MFG_SPECIFIC_IDENTIFY_1" type="INT8U" min="0x0000" max="0xFFFF" writable="true" default="0x0000" optional="true" manufacturerCode="0xABCD">Sample Mfg Specific Attribute: 0x0000 0xABCD</attribute>
<attribute side="server" code="0x0001" define="SAMPLE_MFG_SPECIFIC_IDENTIFY_2" type="INT16U" min="0x0000" max="0xFFFF" writable="true" default="0x0000" optional="true" manufacturerCode="0xABCD">Sample Mfg Specific Attribute: 0x0001 0x1040</attribute>
<command source="client" code="0x01" name="SampleMfgSpecificIdentifyCommand1" optional="true" manufacturerCode="0xABCD">
<description>Command Extension 1</description>
</command>
<command source="client" code="0x02" name="SampleMfgSpecificIdentifyCommand2" optional="true" manufacturerCode="0xABCD">
<description>Command Extension 2</description>
</command>
</clusterExtension>
</configurator>
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册