diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-30 10:33:35 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-30 10:33:35 +0700 |
commit | 1d31e90574c9dc8060670773a99c8a9ea5b2827c (patch) | |
tree | 50c520a5e0bd14dab5e5ad85cdc5dd5e8928ff56 /crypto/test/src | |
parent | Cleanup Stream disposing in Bcpg (diff) | |
download | BouncyCastle.NET-ed25519-1d31e90574c9dc8060670773a99c8a9ea5b2827c.tar.xz |
Some PORTABLE cleanup
Diffstat (limited to 'crypto/test/src')
-rw-r--r-- | crypto/test/src/util/test/SimpleTest.cs | 8 | ||||
-rw-r--r-- | crypto/test/src/util/test/UncloseableStream.cs | 20 |
2 files changed, 5 insertions, 23 deletions
diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs index 91c493ef7..81c38b54f 100644 --- a/crypto/test/src/util/test/SimpleTest.cs +++ b/crypto/test/src/util/test/SimpleTest.cs @@ -187,20 +187,12 @@ namespace Org.BouncyCastle.Utilities.Test public static DateTime MakeUtcDateTime(int year, int month, int day, int hour, int minute, int second) { -#if PORTABLE return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); -#else - return new DateTime(year, month, day, hour, minute, second); -#endif } public static DateTime MakeUtcDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) { -#if PORTABLE return new DateTime(year, month, day, hour, minute, second, millisecond, DateTimeKind.Utc); -#else - return new DateTime(year, month, day, hour, minute, second, millisecond); -#endif } } } diff --git a/crypto/test/src/util/test/UncloseableStream.cs b/crypto/test/src/util/test/UncloseableStream.cs index 0a7a16e66..2ec13f249 100644 --- a/crypto/test/src/util/test/UncloseableStream.cs +++ b/crypto/test/src/util/test/UncloseableStream.cs @@ -6,34 +6,24 @@ using Org.BouncyCastle.Utilities.IO; namespace Org.BouncyCastle.Utilities.Test { /// <summary> - /// This is a testing utility class to check the property that a <c>Stream</c> is never - /// closed in some particular context - typically when wrapped by another <c>Stream</c> that - /// should not be forwarding its <c>Stream.Close()</c> calls. Not needed in production code. + /// This is a testing utility class to check the property that a <see cref="Stream"/> is never disposed in some + /// particular context,typically when wrapped by another <see cref="Stream"/> that should not be forwarding its + /// <see cref="IDisposable.Dispose"/> calls. Not needed in production code. /// </summary> public class UncloseableStream : FilterStream { - public UncloseableStream( - Stream s) + public UncloseableStream(Stream s) : base(s) { } -#if PORTABLE protected override void Dispose(bool disposing) { if (disposing) - { - throw new Exception("UncloseableStream was disposed"); - } + throw new InvalidOperationException("UncloseableStream was disposed"); base.Dispose(disposing); } -#else - public override void Close() - { - throw new Exception("Close() called on UncloseableStream"); - } -#endif } } |