fix(adminui): reject AbLegacy array length >256 at author-time (review I-3)
v2-ci / build (push) Failing after 1m3s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 1m3s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
This commit is contained in:
@@ -99,4 +99,34 @@ public sealed class AbLegacyTagConfigModelTests
|
||||
|
||||
json.ShouldContain("\"deviceHostAddress\":\"ab://host\"");
|
||||
}
|
||||
|
||||
// Array-length cap (review I-3): authored arrayLength > 256 on an AbLegacy array tag must be
|
||||
// rejected at author-time to prevent a Part 6 §5.3.2 ArrayDimensions mismatch at runtime.
|
||||
|
||||
[Fact]
|
||||
public void Validate_returns_error_when_array_length_exceeds_256()
|
||||
{
|
||||
var m = AbLegacyTagConfigModel.FromJson("""{"address":"N7:0","isArray":true,"arrayLength":300}""");
|
||||
|
||||
var error = m.Validate();
|
||||
|
||||
error.ShouldNotBeNull();
|
||||
error.ShouldContain("256");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_returns_null_when_array_length_exactly_256()
|
||||
{
|
||||
var m = AbLegacyTagConfigModel.FromJson("""{"address":"N7:0","isArray":true,"arrayLength":256}""");
|
||||
|
||||
m.Validate().ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_returns_null_for_scalar_tag_regardless_of_no_array_length()
|
||||
{
|
||||
var m = AbLegacyTagConfigModel.FromJson("""{"address":"N7:0"}""");
|
||||
|
||||
m.Validate().ShouldBeNull();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user