Skip to content

Commit 6a4b0e8

Browse files
Copilotstephentoub
andcommitted
Replace NET9_0_OR_GREATER and NET10_0_OR_GREATER in test files
Co-authored-by: stephentoub <[email protected]>
1 parent bd39db3 commit 6a4b0e8

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

src/libraries/Common/tests/System/Security/Cryptography/ByteUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal static byte[] AsciiBytes(string s)
2424

2525
internal static byte[] HexToByteArray(this string hexString)
2626
{
27-
#if NET9_0_OR_GREATER
27+
#if NET
2828
return Convert.FromHexString(hexString);
2929
#else
3030
byte[] bytes = new byte[hexString.Length / 2];
@@ -56,7 +56,7 @@ internal static string ByteArrayToHex(this ReadOnlyMemory<byte> bytes)
5656

5757
internal static string ByteArrayToHex(this ReadOnlySpan<byte> bytes)
5858
{
59-
#if NET9_0_OR_GREATER
59+
#if NET
6060
return Convert.ToHexString(bytes);
6161
#else
6262
StringBuilder builder = new StringBuilder(bytes.Length * 2);
@@ -89,7 +89,7 @@ internal static byte[] RepeatByte(byte b, int count)
8989

9090
internal static bool ContainsAnyExcept(this ReadOnlySpan<byte> bytes, byte value)
9191
{
92-
#if NET9_0_OR_GREATER
92+
#if NET
9393
return bytes.ContainsAnyExcept(value);
9494
#else
9595
foreach (byte b in bytes)

src/libraries/Common/tests/System/Security/Cryptography/X509Certificates/X509CertificateLoaderPkcs12CollectionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ public void LoadWithDuplicateAttributes(bool allowDuplicates)
749749
{
750750
Pkcs12LoaderLimits limits = Pkcs12LoaderLimits.Defaults;
751751

752-
#if !NET10_0_OR_GREATER
752+
#if !NET
753753
if (allowDuplicates)
754754
{
755755
limits = Pkcs12LoaderLimits.DangerousNoLimits;
@@ -759,7 +759,7 @@ public void LoadWithDuplicateAttributes(bool allowDuplicates)
759759
// remove the edit lock
760760
limits = new Pkcs12LoaderLimits(limits)
761761
{
762-
#if NET10_0_OR_GREATER
762+
#if NET
763763
AllowDuplicateAttributes = allowDuplicates,
764764
#endif
765765
PreserveCertificateAlias = false,

src/libraries/Common/tests/System/Security/Cryptography/X509Certificates/X509CertificateLoaderPkcs12Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ public void LoadWithDuplicateAttributes(bool allowDuplicates)
744744
{
745745
Pkcs12LoaderLimits limits = Pkcs12LoaderLimits.Defaults;
746746

747-
#if !NET10_0_OR_GREATER
747+
#if !NET
748748
if (allowDuplicates)
749749
{
750750
limits = Pkcs12LoaderLimits.DangerousNoLimits;
@@ -754,7 +754,7 @@ public void LoadWithDuplicateAttributes(bool allowDuplicates)
754754
// remove the edit lock
755755
limits = new Pkcs12LoaderLimits(limits)
756756
{
757-
#if NET10_0_OR_GREATER
757+
#if NET
758758
AllowDuplicateAttributes = allowDuplicates,
759759
#endif
760760
PreserveCertificateAlias = false,

src/libraries/Microsoft.Extensions.Caching.Memory/tests/AltLookupTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void SimpleStringAccess()
3030
Assert.False(cache.TryGetValue(objKey, out result));
3131
Assert.Null(result);
3232

33-
#if NET9_0_OR_GREATER
33+
#if NET
3434
Assert.False(cache.TryGetValue(stringSpanKey, out result));
3535
Assert.Null(result);
3636

@@ -48,7 +48,7 @@ public void SimpleStringAccess()
4848
Assert.True(cache.TryGetValue(objKey, out result));
4949
Assert.Same(cachedValue, result);
5050

51-
#if NET9_0_OR_GREATER
51+
#if NET
5252
Assert.True(cache.TryGetValue(stringSpanKey, out result));
5353
Assert.Same(cachedValue, result);
5454

@@ -65,7 +65,7 @@ public void SimpleStringAccess()
6565
Assert.False(cache.TryGetValue(objKey, out result));
6666
Assert.Null(result);
6767

68-
#if NET9_0_OR_GREATER
68+
#if NET
6969
Assert.False(cache.TryGetValue(stringSpanKey, out result));
7070
Assert.Null(result);
7171

src/libraries/System.Formats.Asn1/tests/Writer/Asn1WriterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static void Verify(AsnWriter writer, string expectedHex)
1616
Assert.Equal(expectedHex, encoded.ByteArrayToHex());
1717
Assert.Equal(expectedSize, encoded.Length);
1818

19-
#if NET9_0_OR_GREATER
19+
#if NET
2020
string hexEncoded = writer.Encode(Convert.ToHexString);
2121
Assert.Equal(expectedHex, hexEncoded);
2222

src/libraries/System.Formats.Asn1/tests/Writer/PushPopSetOf.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public static void CannotEncodeWhileUnbalanced(AsnEncodingRules ruleSet, bool cu
466466
Assert.Throws<InvalidOperationException>(() => writer.EncodedValueEquals(buf));
467467
Assert.Equal(-5, written);
468468

469-
#if NET9_0_OR_GREATER
469+
#if NET
470470
Assert.Throws<InvalidOperationException>(() => writer.Encode<object>(_ => {
471471
Assert.Fail("Callback should not have been called.");
472472
return null;

src/libraries/System.Formats.Asn1/tests/Writer/SimpleWriterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void EncodeEmpty(AsnEncodingRules ruleSet)
4949
Assert.Equal(0, written);
5050
Assert.True(writer.EncodedValueEquals(ReadOnlySpan<byte>.Empty));
5151

52-
#if NET9_0_OR_GREATER
52+
#if NET
5353
writer.Encode<object>(encoded => {
5454
Assert.Equal(0, encoded.Length);
5555
return null;
@@ -251,7 +251,7 @@ public static void InitialCapacity_ResizeBlockAligns()
251251
Assert.Equal(1024, buffer?.Length);
252252
}
253253

254-
#if NET9_0_OR_GREATER
254+
#if NET
255255
[Fact]
256256
public static void Encode_Callback_NoModifications()
257257
{

src/libraries/System.Text.Json/tests/Common/MetadataTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public async Task ClassWithRefStructConstructorParameter_Serialization()
344344
}
345345
}
346346

347-
#if NET9_0_OR_GREATER
347+
#if NET
348348
[Fact]
349349
public void CollectionWithRefStructElement_Serialization()
350350
{
@@ -635,7 +635,7 @@ public ClassWithRefStructConstructorParameter(ReadOnlySpan<char> value)
635635
public string Value { get; }
636636
}
637637

638-
#if NET9_0_OR_GREATER
638+
#if NET
639639
public class CollectionWithRefStructElement : IEnumerable<ReadOnlySpan<char>>
640640
{
641641
private List<string> _values = new();

src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/MetadataTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public partial class MetadataTests_SourceGen() : MetadataTests(new StringSeriali
4242
[JsonSerializable(typeof(ClassWithRequiredAndOptionalConstructorParameters))]
4343
[JsonSerializable(typeof(ClassWithRefStructProperty))]
4444
[JsonSerializable(typeof(ClassWithRefStructConstructorParameter))]
45-
#if NET9_0_OR_GREATER
45+
#if NET
4646
[JsonSerializable(typeof(CollectionWithRefStructElement))]
4747
#endif
4848
partial class Context : JsonSerializerContext;

src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ public partial class MyContext : JsonSerializerContext
705705
CompilationHelper.AssertEqualDiagnosticMessages(expectedDiagnostics, result.Diagnostics);
706706
}
707707

708-
#if NET9_0_OR_GREATER
708+
#if NET
709709
[Fact]
710710
public void CollectionWithRefStructElement_CompilesWithWarning()
711711
{

0 commit comments

Comments
 (0)