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.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 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
37 changes: 37 additions & 0 deletions
37
src/System.Runtime/tests/System/Runtime/Tests.netstandard.1.7.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,37 @@ | ||
// 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; | ||
using System.Runtime; | ||
using Xunit; | ||
|
||
namespace System.Runtime.Tests | ||
{ | ||
public static class RuntimeHelpersTests | ||
{ | ||
[Fact] | ||
public static void MemoryFailPointTestNoThrow() | ||
{ | ||
MemoryFailPoint memFailPoint = null; | ||
|
||
memFailPoint = new MemoryFailPoint(1); | ||
memFailPoint.Dispose(); | ||
memFailPoint = new MemoryFailPoint(2); | ||
memFailPoint.Dispose(); | ||
} | ||
|
||
[Fact] | ||
public static void MemoryFailPointTestThrow() | ||
{ | ||
Assert.Throws<ArgumentOutOfRangeException>(() => new MemoryFailPoint(Int32.MinValue)); | ||
Assert.Throws<ArgumentOutOfRangeException>(() => new MemoryFailPoint(0)); | ||
} | ||
|
||
[Fact] | ||
[PlatformSpecific(TestPlatforms.Windows)] //https://github.com/dotnet/coreclr/issues/7807 | ||
public static void MemoryFailPointMaxMemoryThrow() | ||
{ | ||
Assert.Throws<InsufficientMemoryException>(() => new MemoryFailPoint(Int32.MaxValue)); | ||
} | ||
} | ||
} |