diff --git a/dotnet/src/ZB.MOM.NatsNet.Server/Internal/ProtoWire.cs b/dotnet/src/ZB.MOM.NatsNet.Server/Internal/ProtoWire.cs index 035e0c4..26ca11e 100644 --- a/dotnet/src/ZB.MOM.NatsNet.Server/Internal/ProtoWire.cs +++ b/dotnet/src/ZB.MOM.NatsNet.Server/Internal/ProtoWire.cs @@ -311,4 +311,10 @@ public static class ProtoWire (byte)((v >> 56) & 0x7F | 0x80), 1]; } + + /// + /// Compatibility mapped entrypoint for PortTracker: protoEncodeVarint. + /// + public static byte[] ProtoEncodeVarint(ulong v) + => EncodeVarint(v); } diff --git a/dotnet/tests/ZB.MOM.NatsNet.Server.Tests/Internal/ProtoWireTests.cs b/dotnet/tests/ZB.MOM.NatsNet.Server.Tests/Internal/ProtoWireTests.cs index 45b5048..2e1af2a 100644 --- a/dotnet/tests/ZB.MOM.NatsNet.Server.Tests/Internal/ProtoWireTests.cs +++ b/dotnet/tests/ZB.MOM.NatsNet.Server.Tests/Internal/ProtoWireTests.cs @@ -74,4 +74,41 @@ public class ProtoWireTests typ.ShouldBe(2); size.ShouldBe(5); } + + [Theory] + [InlineData(1UL << 7, 2)] + [InlineData(1UL << 14, 3)] + [InlineData(1UL << 21, 4)] + [InlineData(1UL << 28, 5)] + [InlineData(1UL << 35, 6)] + [InlineData(1UL << 42, 7)] + [InlineData(1UL << 49, 8)] + [InlineData(1UL << 56, 9)] + [InlineData(1UL << 63, 10)] + public void ProtoEncodeVarint_BoundaryValues_ReturnsExpectedLength(ulong value, int expectedLength) + { + var encoded = ProtoWire.ProtoEncodeVarint(value); + + encoded.Length.ShouldBe(expectedLength); + } + + [Theory] + [InlineData(1UL << 7)] + [InlineData(1UL << 14)] + [InlineData(1UL << 21)] + [InlineData(1UL << 28)] + [InlineData(1UL << 35)] + [InlineData(1UL << 42)] + [InlineData(1UL << 49)] + [InlineData(1UL << 56)] + [InlineData(1UL << 63)] + public void ProtoEncodeVarint_BoundaryValues_RoundTripThroughProtoScanVarint(ulong value) + { + var encoded = ProtoWire.ProtoEncodeVarint(value); + var (decoded, size, err) = ProtoWire.ProtoScanVarint(encoded); + + err.ShouldBeNull(); + size.ShouldBe(encoded.Length); + decoded.ShouldBe(value); + } } diff --git a/porting.db b/porting.db index 3e27d6e..09cdad1 100644 Binary files a/porting.db and b/porting.db differ diff --git a/reports/current.md b/reports/current.md index 13ed1a8..39c1120 100644 --- a/reports/current.md +++ b/reports/current.md @@ -1,6 +1,6 @@ # NATS .NET Porting Status Report -Generated: 2026-02-28 11:33:10 UTC +Generated: 2026-02-28 11:35:12 UTC ## Modules (12 total) @@ -12,10 +12,10 @@ Generated: 2026-02-28 11:33:10 UTC | Status | Count | |--------|-------| -| deferred | 2368 | +| deferred | 2367 | | n_a | 24 | | stub | 1 | -| verified | 1280 | +| verified | 1281 | ## Unit Tests (3257 total) @@ -34,4 +34,4 @@ Generated: 2026-02-28 11:33:10 UTC ## Overall Progress -**2482/6942 items complete (35.8%)** +**2483/6942 items complete (35.8%)** diff --git a/reports/report_c1ae46f.md b/reports/report_c1ae46f.md new file mode 100644 index 0000000..39c1120 --- /dev/null +++ b/reports/report_c1ae46f.md @@ -0,0 +1,37 @@ +# NATS .NET Porting Status Report + +Generated: 2026-02-28 11:35:12 UTC + +## Modules (12 total) + +| Status | Count | +|--------|-------| +| verified | 12 | + +## Features (3673 total) + +| Status | Count | +|--------|-------| +| deferred | 2367 | +| n_a | 24 | +| stub | 1 | +| verified | 1281 | + +## Unit Tests (3257 total) + +| Status | Count | +|--------|-------| +| deferred | 2091 | +| n_a | 187 | +| verified | 979 | + +## Library Mappings (36 total) + +| Status | Count | +|--------|-------| +| mapped | 36 | + + +## Overall Progress + +**2483/6942 items complete (35.8%)**