Skip to content

Commit 22c65cb

Browse files
Add some bits to exercise global structs/enums to Unit Testing cluster. (#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 27501d4 commit 22c65cb

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
@@ -6949,6 +6949,7 @@ internal cluster UnitTesting = 4294048773 {
69496949
SimpleBitmap f = 5;
69506950
single g = 6;
69516951
double h = 7;
6952+
optional TestGlobalEnum i = 8;
69526953
}
69536954

69546955
fabric_scoped struct TestFabricScoped {
@@ -6981,6 +6982,7 @@ internal cluster UnitTesting = 4294048773 {
69816982
int8u a = 0;
69826983
boolean b = 1;
69836984
SimpleStruct c = 2;
6985+
optional TestGlobalStruct d = 3;
69846986
}
69856987

69866988
struct NestedStructList {
@@ -7066,6 +7068,8 @@ internal cluster UnitTesting = 4294048773 {
70667068
timedwrite attribute boolean timedWriteBoolean = 48;
70677069
attribute boolean generalErrorBoolean = 49;
70687070
attribute boolean clusterErrorBoolean = 50;
7071+
attribute TestGlobalEnum globalEnum = 51;
7072+
attribute TestGlobalStruct globalStruct = 52;
70697073
attribute optional boolean unsupported = 255;
70707074
attribute nullable boolean nullableBoolean = 16384;
70717075
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -7101,6 +7105,8 @@ internal cluster UnitTesting = 4294048773 {
71017105
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
71027106
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
71037107
attribute optional int8u writeOnlyInt8u = 16426;
7108+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
7109+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
71047110
attribute int8u meiInt8u = 4294070017;
71057111
readonly attribute command_id generatedCommandList[] = 65528;
71067112
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -7252,6 +7258,11 @@ internal cluster UnitTesting = 4294048773 {
72527258
SimpleEnum arg2 = 1;
72537259
}
72547260

7261+
response struct GlobalEchoResponse = 14 {
7262+
TestGlobalStruct field1 = 0;
7263+
TestGlobalEnum field2 = 1;
7264+
}
7265+
72557266
request struct TestNullableOptionalRequestRequest {
72567267
optional nullable int8u arg1 = 0;
72577268
}
@@ -7305,6 +7316,11 @@ internal cluster UnitTesting = 4294048773 {
73057316
octet_string payload = 0;
73067317
}
73077318

7319+
request struct GlobalEchoRequestRequest {
7320+
TestGlobalStruct field1 = 0;
7321+
TestGlobalEnum field2 = 1;
7322+
}
7323+
73087324
request struct TestDifferentVendorMeiRequestRequest {
73097325
int8u arg1 = 0;
73107326
}
@@ -7388,6 +7404,9 @@ internal cluster UnitTesting = 4294048773 {
73887404
the string back. If the string is large then it would require a session that
73897405
supports large payloads. */
73907406
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
7407+
/** Command that takes arguments that are global structs/enums and the
7408+
response just echoes them back. */
7409+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
73917410
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
73927411
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
73937412
}
@@ -9283,6 +9302,8 @@ endpoint 1 {
92839302
ram attribute timedWriteBoolean;
92849303
callback attribute generalErrorBoolean;
92859304
callback attribute clusterErrorBoolean;
9305+
ram attribute globalEnum;
9306+
callback attribute globalStruct;
92869307
ram attribute nullableBoolean default = false;
92879308
ram attribute nullableBitmap8 default = 0;
92889309
ram attribute nullableBitmap16 default = 0;
@@ -9317,6 +9338,8 @@ endpoint 1 {
93179338
ram attribute nullableRangeRestrictedInt16u default = 200;
93189339
ram attribute nullableRangeRestrictedInt16s default = -100;
93199340
callback attribute writeOnlyInt8u default = 0;
9341+
ram attribute nullableGlobalEnum;
9342+
callback attribute nullableGlobalStruct;
93209343
ram attribute featureMap default = 0;
93219344
ram attribute clusterRevision default = 1;
93229345
ram attribute meiInt8u default = 0;
@@ -9342,6 +9365,7 @@ endpoint 1 {
93429365
handle command TestListInt8UReverseRequest;
93439366
handle command StringEchoResponse;
93449367
handle command TestEnumsRequest;
9368+
handle command GlobalEchoResponse;
93459369
handle command TestNullableOptionalRequest;
93469370
handle command SimpleStructEchoRequest;
93479371
handle command TimedInvokeRequest;
@@ -9351,6 +9375,7 @@ endpoint 1 {
93519375
handle command TestBatchHelperRequest;
93529376
handle command TestSecondBatchHelperRequest;
93539377
handle command StringEchoRequest;
9378+
handle command GlobalEchoRequest;
93549379
handle command TestDifferentVendorMeiRequest;
93559380
handle command TestDifferentVendorMeiResponse;
93569381
}

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

+80
Original file line numberDiff line numberDiff line change
@@ -22341,6 +22341,14 @@
2234122341
"isIncoming": 1,
2234222342
"isEnabled": 1
2234322343
},
22344+
{
22345+
"name": "GlobalEchoResponse",
22346+
"code": 14,
22347+
"mfgCode": null,
22348+
"source": "server",
22349+
"isIncoming": 0,
22350+
"isEnabled": 1
22351+
},
2234422352
{
2234522353
"name": "TestNullableOptionalRequest",
2234622354
"code": 15,
@@ -22413,6 +22421,14 @@
2241322421
"isIncoming": 1,
2241422422
"isEnabled": 1
2241522423
},
22424+
{
22425+
"name": "GlobalEchoRequest",
22426+
"code": 25,
22427+
"mfgCode": null,
22428+
"source": "client",
22429+
"isIncoming": 1,
22430+
"isEnabled": 1
22431+
},
2241622432
{
2241722433
"name": "TestDifferentVendorMeiRequest",
2241822434
"code": 4294049962,
@@ -23183,6 +23199,38 @@
2318323199
"maxInterval": 65534,
2318423200
"reportableChange": 0
2318523201
},
23202+
{
23203+
"name": "global_enum",
23204+
"code": 51,
23205+
"mfgCode": null,
23206+
"side": "server",
23207+
"type": "TestGlobalEnum",
23208+
"included": 1,
23209+
"storageOption": "RAM",
23210+
"singleton": 0,
23211+
"bounded": 0,
23212+
"defaultValue": "",
23213+
"reportable": 1,
23214+
"minInterval": 1,
23215+
"maxInterval": 65534,
23216+
"reportableChange": 0
23217+
},
23218+
{
23219+
"name": "global_struct",
23220+
"code": 52,
23221+
"mfgCode": null,
23222+
"side": "server",
23223+
"type": "TestGlobalStruct",
23224+
"included": 1,
23225+
"storageOption": "External",
23226+
"singleton": 0,
23227+
"bounded": 0,
23228+
"defaultValue": null,
23229+
"reportable": 1,
23230+
"minInterval": 1,
23231+
"maxInterval": 65534,
23232+
"reportableChange": 0
23233+
},
2318623234
{
2318723235
"name": "nullable_boolean",
2318823236
"code": 16384,
@@ -23727,6 +23775,38 @@
2372723775
"maxInterval": 65534,
2372823776
"reportableChange": 0
2372923777
},
23778+
{
23779+
"name": "nullable_global_enum",
23780+
"code": 16435,
23781+
"mfgCode": null,
23782+
"side": "server",
23783+
"type": "TestGlobalEnum",
23784+
"included": 1,
23785+
"storageOption": "RAM",
23786+
"singleton": 0,
23787+
"bounded": 0,
23788+
"defaultValue": "",
23789+
"reportable": 1,
23790+
"minInterval": 1,
23791+
"maxInterval": 65534,
23792+
"reportableChange": 0
23793+
},
23794+
{
23795+
"name": "nullable_global_struct",
23796+
"code": 16436,
23797+
"mfgCode": null,
23798+
"side": "server",
23799+
"type": "TestGlobalStruct",
23800+
"included": 1,
23801+
"storageOption": "External",
23802+
"singleton": 0,
23803+
"bounded": 0,
23804+
"defaultValue": null,
23805+
"reportable": 1,
23806+
"minInterval": 1,
23807+
"maxInterval": 65534,
23808+
"reportableChange": 0
23809+
},
2373023810
{
2373123811
"name": "FeatureMap",
2373223812
"code": 65532,

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

+25
Original file line numberDiff line numberDiff line change
@@ -5540,6 +5540,7 @@ internal cluster UnitTesting = 4294048773 {
55405540
SimpleBitmap f = 5;
55415541
single g = 6;
55425542
double h = 7;
5543+
optional TestGlobalEnum i = 8;
55435544
}
55445545

55455546
fabric_scoped struct TestFabricScoped {
@@ -5572,6 +5573,7 @@ internal cluster UnitTesting = 4294048773 {
55725573
int8u a = 0;
55735574
boolean b = 1;
55745575
SimpleStruct c = 2;
5576+
optional TestGlobalStruct d = 3;
55755577
}
55765578

55775579
struct NestedStructList {
@@ -5657,6 +5659,8 @@ internal cluster UnitTesting = 4294048773 {
56575659
timedwrite attribute boolean timedWriteBoolean = 48;
56585660
attribute boolean generalErrorBoolean = 49;
56595661
attribute boolean clusterErrorBoolean = 50;
5662+
attribute TestGlobalEnum globalEnum = 51;
5663+
attribute TestGlobalStruct globalStruct = 52;
56605664
attribute optional boolean unsupported = 255;
56615665
attribute nullable boolean nullableBoolean = 16384;
56625666
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -5692,6 +5696,8 @@ internal cluster UnitTesting = 4294048773 {
56925696
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
56935697
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
56945698
attribute optional int8u writeOnlyInt8u = 16426;
5699+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
5700+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
56955701
attribute int8u meiInt8u = 4294070017;
56965702
readonly attribute command_id generatedCommandList[] = 65528;
56975703
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -5843,6 +5849,11 @@ internal cluster UnitTesting = 4294048773 {
58435849
SimpleEnum arg2 = 1;
58445850
}
58455851

5852+
response struct GlobalEchoResponse = 14 {
5853+
TestGlobalStruct field1 = 0;
5854+
TestGlobalEnum field2 = 1;
5855+
}
5856+
58465857
request struct TestNullableOptionalRequestRequest {
58475858
optional nullable int8u arg1 = 0;
58485859
}
@@ -5896,6 +5907,11 @@ internal cluster UnitTesting = 4294048773 {
58965907
octet_string payload = 0;
58975908
}
58985909

5910+
request struct GlobalEchoRequestRequest {
5911+
TestGlobalStruct field1 = 0;
5912+
TestGlobalEnum field2 = 1;
5913+
}
5914+
58995915
request struct TestDifferentVendorMeiRequestRequest {
59005916
int8u arg1 = 0;
59015917
}
@@ -5979,6 +5995,9 @@ internal cluster UnitTesting = 4294048773 {
59795995
the string back. If the string is large then it would require a session that
59805996
supports large payloads. */
59815997
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
5998+
/** Command that takes arguments that are global structs/enums and the
5999+
response just echoes them back. */
6000+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
59826001
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
59836002
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
59846003
}
@@ -6840,6 +6859,8 @@ endpoint 1 {
68406859
ram attribute timedWriteBoolean;
68416860
callback attribute generalErrorBoolean;
68426861
callback attribute clusterErrorBoolean;
6862+
ram attribute globalEnum;
6863+
callback attribute globalStruct;
68436864
ram attribute nullableBoolean default = false;
68446865
ram attribute nullableBitmap8 default = 0;
68456866
ram attribute nullableBitmap16 default = 0;
@@ -6874,6 +6895,8 @@ endpoint 1 {
68746895
ram attribute nullableRangeRestrictedInt16u default = 200;
68756896
ram attribute nullableRangeRestrictedInt16s default = -100;
68766897
callback attribute writeOnlyInt8u default = 0;
6898+
ram attribute nullableGlobalEnum;
6899+
callback attribute nullableGlobalStruct;
68776900
ram attribute featureMap default = 0;
68786901
ram attribute clusterRevision default = 1;
68796902
ram attribute meiInt8u default = 0;
@@ -6899,6 +6922,7 @@ endpoint 1 {
68996922
handle command TestListInt8UReverseRequest;
69006923
handle command StringEchoResponse;
69016924
handle command TestEnumsRequest;
6925+
handle command GlobalEchoResponse;
69026926
handle command TestNullableOptionalRequest;
69036927
handle command SimpleStructEchoRequest;
69046928
handle command TimedInvokeRequest;
@@ -6908,6 +6932,7 @@ endpoint 1 {
69086932
handle command TestBatchHelperRequest;
69096933
handle command TestSecondBatchHelperRequest;
69106934
handle command StringEchoRequest;
6935+
handle command GlobalEchoRequest;
69116936
handle command TestDifferentVendorMeiRequest;
69126937
handle command TestDifferentVendorMeiResponse;
69136938
}

0 commit comments

Comments
 (0)