This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose ArgIterator Adding IsArgIteratorSupported and IsArgIteratorNotSupported for tests Asserts PNSE when not supported Fixes: #32898
- Loading branch information
1 parent
fb3e288
commit e9d7a5f
Showing
12 changed files
with
68 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/System.Runtime/tests/System/ArgIteratorTests.netcoreapp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Globalization; | ||
using System.Reflection; | ||
using Xunit; | ||
|
||
namespace System.Tests | ||
{ | ||
public static class ArgIteratorTests | ||
{ | ||
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorNotSupported))] | ||
public unsafe static void ArgIterator_Throws_PlatformNotSupportedException() | ||
{ | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator(new RuntimeArgumentHandle())); | ||
Assert.Throws<PlatformNotSupportedException>(() => { | ||
fixed (void* p = "test") | ||
{ | ||
new ArgIterator(new RuntimeArgumentHandle(), p); | ||
} | ||
}); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().End()); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().Equals(new object())); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().GetHashCode()); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().GetNextArg()); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().GetNextArg(new RuntimeTypeHandle())); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().GetNextArgType()); | ||
Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator().GetRemainingCount()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters