Skip to content

Commit

Permalink
Add some bits to exercise global structs/enums to Unit Testing cluste…
Browse files Browse the repository at this point in the history
…r. (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.
  • Loading branch information
bzbarsky-apple authored and hasty committed Aug 1, 2024
1 parent ee27016 commit aebaedb
Show file tree
Hide file tree
Showing 61 changed files with 5,155 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6965,6 +6965,7 @@ internal cluster UnitTesting = 4294048773 {
SimpleBitmap f = 5;
single g = 6;
double h = 7;
optional TestGlobalEnum i = 8;
}

fabric_scoped struct TestFabricScoped {
Expand Down Expand Up @@ -6997,6 +6998,7 @@ internal cluster UnitTesting = 4294048773 {
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
optional TestGlobalStruct d = 3;
}

struct NestedStructList {
Expand Down Expand Up @@ -7082,6 +7084,8 @@ internal cluster UnitTesting = 4294048773 {
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute TestGlobalEnum globalEnum = 51;
attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
Expand Down Expand Up @@ -7117,6 +7121,8 @@ internal cluster UnitTesting = 4294048773 {
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -7268,6 +7274,11 @@ internal cluster UnitTesting = 4294048773 {
SimpleEnum arg2 = 1;
}

response struct GlobalEchoResponse = 14 {
TestGlobalStruct field1 = 0;
TestGlobalEnum field2 = 1;
}

request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
Expand Down Expand Up @@ -7321,6 +7332,11 @@ internal cluster UnitTesting = 4294048773 {
octet_string payload = 0;
}

request struct GlobalEchoRequestRequest {
TestGlobalStruct field1 = 0;
TestGlobalEnum field2 = 1;
}

request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
Expand Down Expand Up @@ -7404,6 +7420,9 @@ internal cluster UnitTesting = 4294048773 {
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
/** Command that takes arguments that are global structs/enums and the
response just echoes them back. */
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
Expand Down Expand Up @@ -9302,6 +9321,8 @@ endpoint 1 {
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
ram attribute globalEnum;
callback attribute globalStruct;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
Expand Down Expand Up @@ -9336,6 +9357,8 @@ endpoint 1 {
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u default = 0;
ram attribute nullableGlobalEnum;
callback attribute nullableGlobalStruct;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute meiInt8u default = 0;
Expand All @@ -9361,6 +9384,7 @@ endpoint 1 {
handle command TestListInt8UReverseRequest;
handle command StringEchoResponse;
handle command TestEnumsRequest;
handle command GlobalEchoResponse;
handle command TestNullableOptionalRequest;
handle command SimpleStructEchoRequest;
handle command TimedInvokeRequest;
Expand All @@ -9370,6 +9394,7 @@ endpoint 1 {
handle command TestBatchHelperRequest;
handle command TestSecondBatchHelperRequest;
handle command StringEchoRequest;
handle command GlobalEchoRequest;
handle command TestDifferentVendorMeiRequest;
handle command TestDifferentVendorMeiResponse;
}
Expand Down
80 changes: 80 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -22405,6 +22405,14 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "GlobalEchoResponse",
"code": 14,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "TestNullableOptionalRequest",
"code": 15,
Expand Down Expand Up @@ -22477,6 +22485,14 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "GlobalEchoRequest",
"code": 25,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
Expand Down Expand Up @@ -23247,6 +23263,38 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "global_enum",
"code": 51,
"mfgCode": null,
"side": "server",
"type": "TestGlobalEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "global_struct",
"code": 52,
"mfgCode": null,
"side": "server",
"type": "TestGlobalStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "nullable_boolean",
"code": 16384,
Expand Down Expand Up @@ -23791,6 +23839,38 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "nullable_global_enum",
"code": 16435,
"mfgCode": null,
"side": "server",
"type": "TestGlobalEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "nullable_global_struct",
"code": 16436,
"mfgCode": null,
"side": "server",
"type": "TestGlobalStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5556,6 +5556,7 @@ internal cluster UnitTesting = 4294048773 {
SimpleBitmap f = 5;
single g = 6;
double h = 7;
optional TestGlobalEnum i = 8;
}

fabric_scoped struct TestFabricScoped {
Expand Down Expand Up @@ -5588,6 +5589,7 @@ internal cluster UnitTesting = 4294048773 {
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
optional TestGlobalStruct d = 3;
}

struct NestedStructList {
Expand Down Expand Up @@ -5673,6 +5675,8 @@ internal cluster UnitTesting = 4294048773 {
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute TestGlobalEnum globalEnum = 51;
attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
Expand Down Expand Up @@ -5708,6 +5712,8 @@ internal cluster UnitTesting = 4294048773 {
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -5859,6 +5865,11 @@ internal cluster UnitTesting = 4294048773 {
SimpleEnum arg2 = 1;
}

response struct GlobalEchoResponse = 14 {
TestGlobalStruct field1 = 0;
TestGlobalEnum field2 = 1;
}

request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
Expand Down Expand Up @@ -5912,6 +5923,11 @@ internal cluster UnitTesting = 4294048773 {
octet_string payload = 0;
}

request struct GlobalEchoRequestRequest {
TestGlobalStruct field1 = 0;
TestGlobalEnum field2 = 1;
}

request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
Expand Down Expand Up @@ -5995,6 +6011,9 @@ internal cluster UnitTesting = 4294048773 {
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
/** Command that takes arguments that are global structs/enums and the
response just echoes them back. */
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
Expand Down Expand Up @@ -6856,6 +6875,8 @@ endpoint 1 {
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
ram attribute globalEnum;
callback attribute globalStruct;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
Expand Down Expand Up @@ -6890,6 +6911,8 @@ endpoint 1 {
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u default = 0;
ram attribute nullableGlobalEnum;
callback attribute nullableGlobalStruct;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute meiInt8u default = 0;
Expand All @@ -6915,6 +6938,7 @@ endpoint 1 {
handle command TestListInt8UReverseRequest;
handle command StringEchoResponse;
handle command TestEnumsRequest;
handle command GlobalEchoResponse;
handle command TestNullableOptionalRequest;
handle command SimpleStructEchoRequest;
handle command TimedInvokeRequest;
Expand All @@ -6924,6 +6948,7 @@ endpoint 1 {
handle command TestBatchHelperRequest;
handle command TestSecondBatchHelperRequest;
handle command StringEchoRequest;
handle command GlobalEchoRequest;
handle command TestDifferentVendorMeiRequest;
handle command TestDifferentVendorMeiResponse;
}
Expand Down
Loading

0 comments on commit aebaedb

Please sign in to comment.