Skip to content

Commit a0d7201

Browse files
CodeQL: fix net48 breakage (#7542)
Accidentally broke CodeQL on #7539 due to a syntax change that Mono does not support.
1 parent 7c22d05 commit a0d7201

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/core/Akka.Streams.Tests/IO/TcpSpec.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ await ValidateServerClientCommunicationAsync(testData, serverConnection, tcpRead
6565
public async Task Outgoing_TCP_stream_must_be_able_to_write_a_sequence_of_ByteStrings()
6666
{
6767
var server = await new Server(this).InitializeAsync();
68-
var testInput = Enumerable.Range(0, 256).Select(i => ByteString.FromBytes(new[] {Convert.ToByte(i)}));
68+
var testInput = Enumerable.Range(0, 256).Select(i => ByteString.FromBytes(new byte[] {Convert.ToByte(i)}));
6969
var expectedOutput = ByteString.FromBytes(Enumerable.Range(0, 256).Select(Convert.ToByte).ToArray());
7070

7171
Source.From(testInput)
@@ -466,7 +466,7 @@ public async Task Outgoing_TCP_stream_must_Echo_should_work_even_if_server_is_in
466466
.Run(Materializer);
467467

468468
var result = await Source.From(Enumerable.Repeat(0, 1000)
469-
.Select(i => ByteString.FromBytes(new[] {Convert.ToByte(i)})))
469+
.Select(i => ByteString.FromBytes(new byte[] { Convert.ToByte(i) })))
470470
.Via(Sys.TcpStream().OutgoingConnection(serverAddress, halfClose: true))
471471
.RunAggregate(0, (i, s) => i + s.Count, Materializer).ShouldCompleteWithin(10.Seconds());
472472

@@ -573,7 +573,7 @@ public async Task Tcp_listen_stream_must_be_able_to_implement_echo()
573573
var binding = await bindTask.ShouldCompleteWithin(3.Seconds());
574574

575575
var testInput = Enumerable.Range(0, 255)
576-
.Select(i => ByteString.FromBytes(new[] {Convert.ToByte(i)}))
576+
.Select(i => ByteString.FromBytes(new byte[] { Convert.ToByte(i) }))
577577
.ToList();
578578

579579
var expectedOutput = testInput.Aggregate(ByteString.Empty, (agg, b) => agg.Concat(b));
@@ -603,7 +603,7 @@ public async Task Tcp_listen_stream_must_work_with_a_chain_of_echoes()
603603
var echoConnection = Sys.TcpStream().OutgoingConnection(serverAddress);
604604

605605
var testInput = Enumerable.Range(0, 255)
606-
.Select(i => ByteString.FromBytes([Convert.ToByte(i)]))
606+
.Select(i => ByteString.FromBytes(new byte[] { Convert.ToByte(i) }))
607607
.ToList();
608608

609609
var expectedOutput = testInput.Aggregate(ByteString.Empty, (agg, b) => agg.Concat(b));

src/core/Akka.Tests/IO/TcpIntegrationSpec.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public async Task When_multiple_concurrent_writing_clients_All_acks_should_be_re
341341
var clients = indexRange.Select(i => (Index: i, Probe: CreateTestProbe($"test-client-{i}"))).ToArray();
342342
Parallel.ForEach(clients, client =>
343343
{
344-
var msg = ByteString.FromBytes(new byte[1]);
344+
var msg = ByteString.FromBytes(new byte[] {(byte) 0});
345345
client.Probe.Send(actors.ClientConnection, Tcp.Write.Create(msg, AckWithValue.Create(client.Index)));
346346
});
347347

@@ -519,7 +519,7 @@ await AwaitConditionNoThrowAsync(() =>
519519

520520
private async Task ChitChat(TestSetup.ConnectionDetail actors, int rounds = 100)
521521
{
522-
var testData = ByteString.FromBytes(new[] {(byte) 0});
522+
var testData = ByteString.FromBytes(new byte[] {(byte) 0});
523523
for (int i = 0; i < rounds; i++)
524524
{
525525
actors.ClientHandler.Send(actors.ClientConnection, Tcp.Write.Create(testData));

0 commit comments

Comments
 (0)