Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build break #99328

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public static byte[] ReaderLoop(int inpuDataLength, out int length, ref Utf8Json
ReadOnlySpan<byte> valueSpan = json.HasValueSequence ? json.ValueSequence.ToArray() : json.ValueSpan;
if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default);
Assert.True(json.ValueSpan.IsEmpty);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these tests wants to really test for default. This build break should be fixed by pragma warning disable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's my thinking too. I wanted to see if there are more breaks after these ones are fixed.

Copy link
Contributor

@buyaa-n buyaa-n Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the analyzer should be disabled for test projects, could you please add below rows here:

# CA2261: Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
dotnet_diagnostic.CA2261.severity = none

# CA2265: Do not compare Span<T> to 'null' or 'default'
dotnet_diagnostic.CA2265.severity = none

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the analyzer updated reverted, this can be added later when analyzer updated

if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetString().Length != 0)
{
// Empty strings could still make this true, i.e. ""
Expand All @@ -411,7 +411,7 @@ public static byte[] ReaderLoop(int inpuDataLength, out int length, ref Utf8Json
if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetString().Length != 0)
{
// Empty strings could still make this true, i.e. ""
Assert.False(json.ValueSpan == default);
Assert.False(json.ValueSpan.IsEmpty);
}
}
switch (tokenType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@
builder.Append(Encoding.UTF8.GetString(json.HasValueSequence ? json.ValueSequence.ToArray() : json.ValueSpan.ToArray()));
if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default);
Assert.True(json.ValueSpan.IsEmpty);
}
else
{
Expand All @@ -1112,7 +1112,7 @@
builder.Append(Encoding.UTF8.GetString(json.HasValueSequence ? json.ValueSequence.ToArray() : json.ValueSpan.ToArray()));
if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default);
Assert.True(json.ValueSpan.IsEmpty);
}
else
{
Expand Down Expand Up @@ -1158,7 +1158,7 @@

if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default);
Assert.True(json.ValueSpan.IsEmpty);
}
else
{
Expand Down Expand Up @@ -1277,13 +1277,13 @@
}
if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default, $"Escaped ValueSpan to be empty when HasValueSequence is true. Test case: {testCase}");

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1280 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1280

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1280,37): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.False(json.ValueSequence.IsEmpty, $"Escaped ValueSequence to not be empty when HasValueSequence is true. Test case: {testCase}");
}
else
{
Assert.True(json.ValueSequence.IsEmpty, $"Escaped ValueSequence to be empty when HasValueSequence is false. Test case: {testCase}");
Assert.False(json.ValueSpan == default, $"Escaped ValueSpan to not be empty when HasValueSequence is false. Test case: {testCase}");

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1286 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1286

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1286,38): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
}

index++;
Expand All @@ -1309,18 +1309,18 @@
var json = new Utf8JsonReader(sequence, isFinalBlock: true, state);

Assert.False(json.HasValueSequence);
Assert.True(json.ValueSpan == default);

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1312 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1312

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1312,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.True(json.ValueSequence.IsEmpty);

Assert.True(json.Read());
Assert.True(json.HasValueSequence);
Assert.True(json.ValueSpan == default);

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1317 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1317

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1317,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.False(json.ValueSequence.IsEmpty);

// Subsequent calls to Read clears the value properties since Read returned false.
Assert.False(json.Read());
Assert.False(json.HasValueSequence);
Assert.True(json.ValueSpan == default);

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1323 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1323

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1323,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.True(json.ValueSequence.IsEmpty);
}

Expand All @@ -1329,12 +1329,12 @@
var json = new Utf8JsonReader(sequence, new JsonReaderOptions { CommentHandling = commentHandling });

Assert.False(json.HasValueSequence);
Assert.True(json.ValueSpan == default);

Check failure on line 1332 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1332

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1332,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1332 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1332

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1332,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.True(json.ValueSequence.IsEmpty);

Assert.True(json.Read());
Assert.True(json.HasValueSequence);
Assert.True(json.ValueSpan == default);

Check failure on line 1337 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1337

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1337,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)

Check failure on line 1337 in src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs#L1337

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs(1337,29): error CA2265: (NETCORE_ENGINEERING_TELEMETRY=Build) Comparing a span to 'default' might not do what you intended, make the code more explicit by checking 'IsEmpty' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265)
Assert.False(json.ValueSequence.IsEmpty);

// Subsequent calls to Read clears the value properties since Read returned false.
Expand Down
Loading