Skip to content

Commit a18dce7

Browse files
committed
Add code to handle obsolete conformance when rendering
1 parent b0c9c91 commit a18dce7

6 files changed

Lines changed: 11 additions & 2 deletions

File tree

dm/conformance.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func renderConformance(con conformance.Conformance, parentEntity types.Entity) (
9090
element = etree.NewElement("deprecateConform")
9191
case *conformance.Described:
9292
element = etree.NewElement("describedConform")
93+
case *conformance.Obsolete:
94+
element = etree.NewElement("obsoleteConform")
9395
case *conformance.Generic:
9496
err = fmt.Errorf("generic conformance elements are not supported in XML")
9597
case conformance.Set:

matter/conformance/obsolete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type Obsolete struct {
55
}
66

77
func (d *Obsolete) Type() Type {
8-
return TypeDeprecated
8+
return TypeObsolete
99
}
1010

1111
func (d *Obsolete) RawText() string {

matter/conformance/type.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
TypeOptional
1414
TypeProvisional
1515
TypeDeprecated
16+
TypeObsolete
1617
TypeDisallowed
1718
TypeDescribed
1819
TypeGeneric
@@ -25,6 +26,7 @@ var TypeNames = map[Type]string{
2526
TypeOptional: "optional",
2627
TypeProvisional: "provisional",
2728
TypeDeprecated: "deprecated",
29+
TypeObsolete: "obsolete",
2830
TypeDisallowed: "disallowed",
2931
TypeDescribed: "described",
3032
TypeGeneric: "generic",

matter/spec/conformance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (sp *Builder) resolveEntityConformanceReferences(cluster *matter.Cluster, f
171171
for _, c := range con {
172172
sp.resolveEntityConformanceReferences(cluster, finder, source, c)
173173
}
174-
case *conformance.Disallowed, *conformance.Provisional, *conformance.Described, *conformance.Deprecated:
174+
case *conformance.Disallowed, *conformance.Provisional, *conformance.Described, *conformance.Deprecated, *conformance.Obsolete:
175175
case *conformance.Generic:
176176
if !conformance.IsBlank(con) {
177177
slog.Warn("Can not resolve entities on generic conformance", slog.String("conformance", con.RawText()), log.Path("source", source))

testscript/python/conformance.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ func buildPythonConformance(cluster *matter.Cluster, c conformance.Conformance,
104104
switch c := c.(type) {
105105
case *conformance.Deprecated:
106106
return fmt.Errorf("deprecated conformance cannot be converted to Python")
107+
case *conformance.Obsolete:
108+
return fmt.Errorf("obsolete conformance cannot be converted to Python")
107109
case *conformance.Described:
108110
return fmt.Errorf("described conformance cannot be converted to Python")
109111
case *conformance.Generic:

zap/parse/conformance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func parseConformance(d *xml.Decoder, e xml.StartElement) (c conformance.Conform
4444
case "describedConform":
4545
err = parseStandalone(d, e, e.Name.Local)
4646
c = &conformance.Described{}
47+
case "obsoleteConform":
48+
err = parseStandalone(d, e, e.Name.Local)
49+
c = &conformance.Obsolete{}
4750
case "otherwiseConform":
4851
c, err = parseOtherwiseConform(d, e)
4952
default:

0 commit comments

Comments
 (0)