Skip to content

Commit aebaedb

Browse files
bzbarsky-applehasty
authored andcommitted
Add some bits to exercise global structs/enums to Unit Testing cluster. (project-chip#34540)
* Adds things to the Unit Testing cluster XML. * This requires those things to be enabled in all-clusters-app, all-clusters-minimal-app, and one of the chef contact sensors to pass CI. * That requires an implementation in test-cluster-server * At which point might as well add a YAML test to exercise it all.
1 parent ee27016 commit aebaedb

File tree

61 files changed

+5155
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5155
-282
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+25
Original file line numberDiff line numberDiff line change
@@ -6965,6 +6965,7 @@ internal cluster UnitTesting = 4294048773 {
69656965
SimpleBitmap f = 5;
69666966
single g = 6;
69676967
double h = 7;
6968+
optional TestGlobalEnum i = 8;
69686969
}
69696970

69706971
fabric_scoped struct TestFabricScoped {
@@ -6997,6 +6998,7 @@ internal cluster UnitTesting = 4294048773 {
69976998
int8u a = 0;
69986999
boolean b = 1;
69997000
SimpleStruct c = 2;
7001+
optional TestGlobalStruct d = 3;
70007002
}
70017003

70027004
struct NestedStructList {
@@ -7082,6 +7084,8 @@ internal cluster UnitTesting = 4294048773 {
70827084
timedwrite attribute boolean timedWriteBoolean = 48;
70837085
attribute boolean generalErrorBoolean = 49;
70847086
attribute boolean clusterErrorBoolean = 50;
7087+
attribute TestGlobalEnum globalEnum = 51;
7088+
attribute TestGlobalStruct globalStruct = 52;
70857089
attribute optional boolean unsupported = 255;
70867090
attribute nullable boolean nullableBoolean = 16384;
70877091
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -7117,6 +7121,8 @@ internal cluster UnitTesting = 4294048773 {
71177121
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
71187122
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
71197123
attribute optional int8u writeOnlyInt8u = 16426;
7124+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
7125+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
71207126
attribute int8u meiInt8u = 4294070017;
71217127
readonly attribute command_id generatedCommandList[] = 65528;
71227128
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -7268,6 +7274,11 @@ internal cluster UnitTesting = 4294048773 {
72687274
SimpleEnum arg2 = 1;
72697275
}
72707276

7277+
response struct GlobalEchoResponse = 14 {
7278+
TestGlobalStruct field1 = 0;
7279+
TestGlobalEnum field2 = 1;
7280+
}
7281+
72717282
request struct TestNullableOptionalRequestRequest {
72727283
optional nullable int8u arg1 = 0;
72737284
}
@@ -7321,6 +7332,11 @@ internal cluster UnitTesting = 4294048773 {
73217332
octet_string payload = 0;
73227333
}
73237334

7335+
request struct GlobalEchoRequestRequest {
7336+
TestGlobalStruct field1 = 0;
7337+
TestGlobalEnum field2 = 1;
7338+
}
7339+
73247340
request struct TestDifferentVendorMeiRequestRequest {
73257341
int8u arg1 = 0;
73267342
}
@@ -7404,6 +7420,9 @@ internal cluster UnitTesting = 4294048773 {
74047420
the string back. If the string is large then it would require a session that
74057421
supports large payloads. */
74067422
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
7423+
/** Command that takes arguments that are global structs/enums and the
7424+
response just echoes them back. */
7425+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
74077426
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
74087427
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
74097428
}
@@ -9302,6 +9321,8 @@ endpoint 1 {
93029321
ram attribute timedWriteBoolean;
93039322
callback attribute generalErrorBoolean;
93049323
callback attribute clusterErrorBoolean;
9324+
ram attribute globalEnum;
9325+
callback attribute globalStruct;
93059326
ram attribute nullableBoolean default = false;
93069327
ram attribute nullableBitmap8 default = 0;
93079328
ram attribute nullableBitmap16 default = 0;
@@ -9336,6 +9357,8 @@ endpoint 1 {
93369357
ram attribute nullableRangeRestrictedInt16u default = 200;
93379358
ram attribute nullableRangeRestrictedInt16s default = -100;
93389359
callback attribute writeOnlyInt8u default = 0;
9360+
ram attribute nullableGlobalEnum;
9361+
callback attribute nullableGlobalStruct;
93399362
ram attribute featureMap default = 0;
93409363
ram attribute clusterRevision default = 1;
93419364
ram attribute meiInt8u default = 0;
@@ -9361,6 +9384,7 @@ endpoint 1 {
93619384
handle command TestListInt8UReverseRequest;
93629385
handle command StringEchoResponse;
93639386
handle command TestEnumsRequest;
9387+
handle command GlobalEchoResponse;
93649388
handle command TestNullableOptionalRequest;
93659389
handle command SimpleStructEchoRequest;
93669390
handle command TimedInvokeRequest;
@@ -9370,6 +9394,7 @@ endpoint 1 {
93709394
handle command TestBatchHelperRequest;
93719395
handle command TestSecondBatchHelperRequest;
93729396
handle command StringEchoRequest;
9397+
handle command GlobalEchoRequest;
93739398
handle command TestDifferentVendorMeiRequest;
93749399
handle command TestDifferentVendorMeiResponse;
93759400
}

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+80
Original file line numberDiff line numberDiff line change
@@ -22405,6 +22405,14 @@
2240522405
"isIncoming": 1,
2240622406
"isEnabled": 1
2240722407
},
22408+
{
22409+
"name": "GlobalEchoResponse",
22410+
"code": 14,
22411+
"mfgCode": null,
22412+
"source": "server",
22413+
"isIncoming": 0,
22414+
"isEnabled": 1
22415+
},
2240822416
{
2240922417
"name": "TestNullableOptionalRequest",
2241022418
"code": 15,
@@ -22477,6 +22485,14 @@
2247722485
"isIncoming": 1,
2247822486
"isEnabled": 1
2247922487
},
22488+
{
22489+
"name": "GlobalEchoRequest",
22490+
"code": 25,
22491+
"mfgCode": null,
22492+
"source": "client",
22493+
"isIncoming": 1,
22494+
"isEnabled": 1
22495+
},
2248022496
{
2248122497
"name": "TestDifferentVendorMeiRequest",
2248222498
"code": 4294049962,
@@ -23247,6 +23263,38 @@
2324723263
"maxInterval": 65534,
2324823264
"reportableChange": 0
2324923265
},
23266+
{
23267+
"name": "global_enum",
23268+
"code": 51,
23269+
"mfgCode": null,
23270+
"side": "server",
23271+
"type": "TestGlobalEnum",
23272+
"included": 1,
23273+
"storageOption": "RAM",
23274+
"singleton": 0,
23275+
"bounded": 0,
23276+
"defaultValue": "",
23277+
"reportable": 1,
23278+
"minInterval": 1,
23279+
"maxInterval": 65534,
23280+
"reportableChange": 0
23281+
},
23282+
{
23283+
"name": "global_struct",
23284+
"code": 52,
23285+
"mfgCode": null,
23286+
"side": "server",
23287+
"type": "TestGlobalStruct",
23288+
"included": 1,
23289+
"storageOption": "External",
23290+
"singleton": 0,
23291+
"bounded": 0,
23292+
"defaultValue": null,
23293+
"reportable": 1,
23294+
"minInterval": 1,
23295+
"maxInterval": 65534,
23296+
"reportableChange": 0
23297+
},
2325023298
{
2325123299
"name": "nullable_boolean",
2325223300
"code": 16384,
@@ -23791,6 +23839,38 @@
2379123839
"maxInterval": 65534,
2379223840
"reportableChange": 0
2379323841
},
23842+
{
23843+
"name": "nullable_global_enum",
23844+
"code": 16435,
23845+
"mfgCode": null,
23846+
"side": "server",
23847+
"type": "TestGlobalEnum",
23848+
"included": 1,
23849+
"storageOption": "RAM",
23850+
"singleton": 0,
23851+
"bounded": 0,
23852+
"defaultValue": "",
23853+
"reportable": 1,
23854+
"minInterval": 1,
23855+
"maxInterval": 65534,
23856+
"reportableChange": 0
23857+
},
23858+
{
23859+
"name": "nullable_global_struct",
23860+
"code": 16436,
23861+
"mfgCode": null,
23862+
"side": "server",
23863+
"type": "TestGlobalStruct",
23864+
"included": 1,
23865+
"storageOption": "External",
23866+
"singleton": 0,
23867+
"bounded": 0,
23868+
"defaultValue": null,
23869+
"reportable": 1,
23870+
"minInterval": 1,
23871+
"maxInterval": 65534,
23872+
"reportableChange": 0
23873+
},
2379423874
{
2379523875
"name": "FeatureMap",
2379623876
"code": 65532,

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+25
Original file line numberDiff line numberDiff line change
@@ -5556,6 +5556,7 @@ internal cluster UnitTesting = 4294048773 {
55565556
SimpleBitmap f = 5;
55575557
single g = 6;
55585558
double h = 7;
5559+
optional TestGlobalEnum i = 8;
55595560
}
55605561

55615562
fabric_scoped struct TestFabricScoped {
@@ -5588,6 +5589,7 @@ internal cluster UnitTesting = 4294048773 {
55885589
int8u a = 0;
55895590
boolean b = 1;
55905591
SimpleStruct c = 2;
5592+
optional TestGlobalStruct d = 3;
55915593
}
55925594

55935595
struct NestedStructList {
@@ -5673,6 +5675,8 @@ internal cluster UnitTesting = 4294048773 {
56735675
timedwrite attribute boolean timedWriteBoolean = 48;
56745676
attribute boolean generalErrorBoolean = 49;
56755677
attribute boolean clusterErrorBoolean = 50;
5678+
attribute TestGlobalEnum globalEnum = 51;
5679+
attribute TestGlobalStruct globalStruct = 52;
56765680
attribute optional boolean unsupported = 255;
56775681
attribute nullable boolean nullableBoolean = 16384;
56785682
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -5708,6 +5712,8 @@ internal cluster UnitTesting = 4294048773 {
57085712
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
57095713
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
57105714
attribute optional int8u writeOnlyInt8u = 16426;
5715+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
5716+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
57115717
attribute int8u meiInt8u = 4294070017;
57125718
readonly attribute command_id generatedCommandList[] = 65528;
57135719
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -5859,6 +5865,11 @@ internal cluster UnitTesting = 4294048773 {
58595865
SimpleEnum arg2 = 1;
58605866
}
58615867

5868+
response struct GlobalEchoResponse = 14 {
5869+
TestGlobalStruct field1 = 0;
5870+
TestGlobalEnum field2 = 1;
5871+
}
5872+
58625873
request struct TestNullableOptionalRequestRequest {
58635874
optional nullable int8u arg1 = 0;
58645875
}
@@ -5912,6 +5923,11 @@ internal cluster UnitTesting = 4294048773 {
59125923
octet_string payload = 0;
59135924
}
59145925

5926+
request struct GlobalEchoRequestRequest {
5927+
TestGlobalStruct field1 = 0;
5928+
TestGlobalEnum field2 = 1;
5929+
}
5930+
59155931
request struct TestDifferentVendorMeiRequestRequest {
59165932
int8u arg1 = 0;
59175933
}
@@ -5995,6 +6011,9 @@ internal cluster UnitTesting = 4294048773 {
59956011
the string back. If the string is large then it would require a session that
59966012
supports large payloads. */
59976013
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
6014+
/** Command that takes arguments that are global structs/enums and the
6015+
response just echoes them back. */
6016+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
59986017
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
59996018
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
60006019
}
@@ -6856,6 +6875,8 @@ endpoint 1 {
68566875
ram attribute timedWriteBoolean;
68576876
callback attribute generalErrorBoolean;
68586877
callback attribute clusterErrorBoolean;
6878+
ram attribute globalEnum;
6879+
callback attribute globalStruct;
68596880
ram attribute nullableBoolean default = false;
68606881
ram attribute nullableBitmap8 default = 0;
68616882
ram attribute nullableBitmap16 default = 0;
@@ -6890,6 +6911,8 @@ endpoint 1 {
68906911
ram attribute nullableRangeRestrictedInt16u default = 200;
68916912
ram attribute nullableRangeRestrictedInt16s default = -100;
68926913
callback attribute writeOnlyInt8u default = 0;
6914+
ram attribute nullableGlobalEnum;
6915+
callback attribute nullableGlobalStruct;
68936916
ram attribute featureMap default = 0;
68946917
ram attribute clusterRevision default = 1;
68956918
ram attribute meiInt8u default = 0;
@@ -6915,6 +6938,7 @@ endpoint 1 {
69156938
handle command TestListInt8UReverseRequest;
69166939
handle command StringEchoResponse;
69176940
handle command TestEnumsRequest;
6941+
handle command GlobalEchoResponse;
69186942
handle command TestNullableOptionalRequest;
69196943
handle command SimpleStructEchoRequest;
69206944
handle command TimedInvokeRequest;
@@ -6924,6 +6948,7 @@ endpoint 1 {
69246948
handle command TestBatchHelperRequest;
69256949
handle command TestSecondBatchHelperRequest;
69266950
handle command StringEchoRequest;
6951+
handle command GlobalEchoRequest;
69276952
handle command TestDifferentVendorMeiRequest;
69286953
handle command TestDifferentVendorMeiResponse;
69296954
}

0 commit comments

Comments
 (0)