@@ -395,6 +395,70 @@ def testAttributes(self):
395395
396396 self .assertIdlEqual (xml_idl , expected_idl )
397397
398+ def testXmlNameWorkarounds (self ):
399+ # Validate an attribute with a type list
400+ # This is a manually-edited copy of an attribute test (not real data)
401+
402+ xml_idl = XmlToIdl ('''
403+ <cluster id="123" name="Test" revision="1">
404+ <dataTypes>
405+ <struct name="OutputInfoStruct">
406+ <field id="0" name="ID" type="<<ref_DataTypeString>>">
407+ <access read="true" write="true"/>
408+ <mandatoryConform/>
409+ </field>
410+ <field id="1" name="items" type="<<ref_DataTypeList>>[uint8]">
411+ <access read="true" write="true"/>
412+ <mandatoryConform/>
413+ </field>
414+ <field id="2" name="endpoints" type="<<ref_DataTypeList>>[<<ref_DataTypeEndpointNumber>> Type]">
415+ <access read="true" write="true"/>
416+ <mandatoryConform/>
417+ </field>
418+ </struct>
419+ </dataTypes>
420+ <attributes>
421+ <attribute id="0x0000" name="OutputList" type="list[OutputInfoStruct Type]">
422+ <access read="true" readPrivilege="view"/>
423+ <mandatoryConform/>
424+ </attribute>
425+ <attribute id="0x0001" name="TestConform" type="enum8">
426+ <access read="true" readPrivilege="view"/>
427+ <otherwiseConform>
428+ <mandatoryConform>
429+ <feature name="PRSCONST"/>
430+ </mandatoryConform>
431+ <optionalConform>
432+ <feature name="AUTO"/>
433+ </optionalConform>
434+ </otherwiseConform>
435+ </attribute>
436+ </attributes>
437+ </cluster>
438+ ''' )
439+
440+ expected_idl = IdlTextToIdl ('''
441+ client cluster Test = 123 {
442+ struct OutputInfoStruct {
443+ char_string id = 0;
444+ int8u items[] = 1;
445+ endpoint_no endpoints[] = 2;
446+ }
447+
448+ readonly attribute OutputInfoStruct outputList[] = 0;
449+ readonly attribute optional enum8 testConform = 1;
450+
451+ readonly attribute attrib_id attributeList[] = 65531;
452+ readonly attribute event_id eventList[] = 65530;
453+ readonly attribute command_id acceptedCommandList[] = 65529;
454+ readonly attribute command_id generatedCommandList[] = 65528;
455+ readonly attribute bitmap32 featureMap = 65532;
456+ readonly attribute int16u clusterRevision = 65533;
457+ }
458+ ''' )
459+
460+ self .assertIdlEqual (xml_idl , expected_idl )
461+
398462 def testComplexInput (self ):
399463 # This parses a known copy of Switch.xml which happens to be fully
400464 # spec-conformant (so assuming it as a good input)
0 commit comments