diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-02 17:47:57 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-02 17:47:57 +0700 |
commit | 7c0861e327e642b108bafe61a9d0f90175b4b4eb (patch) | |
tree | 5022fd82facef93fabe9160460a41bf37a10d809 /crypto | |
parent | MethodImplOptions in GCMBlockCipher (diff) | |
download | BouncyCastle.NET-ed25519-7c0861e327e642b108bafe61a9d0f90175b4b4eb.tar.xz |
Clean up tests
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/test/src/asn1/test/ASN1IntegerTest.cs | 12 | ||||
-rw-r--r-- | crypto/test/src/asn1/test/MiscTest.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/SP80038GTest.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/test/BlockCipherTest.cs | 8 | ||||
-rw-r--r-- | crypto/test/src/test/SP80038GTest.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/tls/test/TlsTestUtilities.cs | 4 |
6 files changed, 2 insertions, 34 deletions
diff --git a/crypto/test/src/asn1/test/ASN1IntegerTest.cs b/crypto/test/src/asn1/test/ASN1IntegerTest.cs index 1735db9a6..10570c800 100644 --- a/crypto/test/src/asn1/test/ASN1IntegerTest.cs +++ b/crypto/test/src/asn1/test/ASN1IntegerTest.cs @@ -24,9 +24,6 @@ namespace Org.BouncyCastle.Asn1.Tests public override void PerformTest() { -#if PORTABLE && !DOTNET - // Can't SetEnvironmentVariable ! -#else SetAllowUnsafeProperty(true); Asn1Sequence.GetInstance(suspectKey); @@ -37,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Tests DoTestInvalidEncoding_ff(); DoTestInvalidEncoding_00_32bits(); DoTestInvalidEncoding_ff_32bits(); - //DoDoTestLooseInvalidValidEncoding_FF_32B(); + //DoTestLooseInvalidValidEncoding_FF_32B(); //DoTestLooseInvalidValidEncoding_zero_32B(); DoTestLooseValidEncoding_zero_32BAligned(); DoTestLooseValidEncoding_FF_32BAligned(); @@ -114,7 +111,6 @@ namespace Org.BouncyCastle.Asn1.Tests { CheckArgumentException(e, "malformed enumerated"); } -#endif } /** @@ -255,7 +251,7 @@ namespace Org.BouncyCastle.Asn1.Tests } } - public void DoDoTestLooseInvalidValidEncoding_FF_32B() + public void DoTestLooseInvalidValidEncoding_FF_32B() throws Exception { // @@ -351,11 +347,7 @@ namespace Org.BouncyCastle.Asn1.Tests private void SetAllowUnsafeProperty(bool allowUnsafe) { -#if PORTABLE && !DOTNET - // Can't SetEnvironmentVariable ! -#else Environment.SetEnvironmentVariable(DerInteger.AllowUnsafeProperty, allowUnsafe ? "true" : "false"); -#endif } private void CheckIntValue(DerInteger i, int n) diff --git a/crypto/test/src/asn1/test/MiscTest.cs b/crypto/test/src/asn1/test/MiscTest.cs index c2a5528dc..475055f2d 100644 --- a/crypto/test/src/asn1/test/MiscTest.cs +++ b/crypto/test/src/asn1/test/MiscTest.cs @@ -85,11 +85,7 @@ namespace Org.BouncyCastle.Asn1.Tests private void SetAllowUnsafeProperty(bool allowUnsafe) { -#if PORTABLE && !DOTNET - // Can't SetEnvironmentVariable ! -#else Environment.SetEnvironmentVariable(DerInteger.AllowUnsafeProperty, allowUnsafe ? "true" : "false"); -#endif } public override void PerformTest() diff --git a/crypto/test/src/crypto/test/SP80038GTest.cs b/crypto/test/src/crypto/test/SP80038GTest.cs index 659df7574..e48d1ad4c 100644 --- a/crypto/test/src/crypto/test/SP80038GTest.cs +++ b/crypto/test/src/crypto/test/SP80038GTest.cs @@ -275,9 +275,6 @@ namespace Org.BouncyCastle.Crypto.Tests private void ImplTestDisable() { -#if PORTABLE && !DOTNET - // Can't SetEnvironmentVariable ! -#else Environment.SetEnvironmentVariable("org.bouncycastle.fpe.disable", "true"); try { @@ -313,7 +310,6 @@ namespace Org.BouncyCastle.Crypto.Tests ImplTestFF3_1(); Environment.SetEnvironmentVariable("org.bouncycastle.fpe.disable_ff1", "false"); -#endif } private void ImplTestFF3_1_255() diff --git a/crypto/test/src/test/BlockCipherTest.cs b/crypto/test/src/test/BlockCipherTest.cs index 855e3a3da..ac6d1af33 100644 --- a/crypto/test/src/test/BlockCipherTest.cs +++ b/crypto/test/src/test/BlockCipherTest.cs @@ -472,11 +472,7 @@ namespace Org.BouncyCastle.Tests SecureRandom rand = new FixedSecureRandom(); -#if PORTABLE - string upper = algorithm.ToUpperInvariant(); -#else string upper = algorithm.ToUpper(CultureInfo.InvariantCulture); -#endif string[] parts = upper.Split('/'); string baseAlgorithm = parts[0]; string mode = parts.Length > 1 ? parts[1] : null; @@ -509,11 +505,7 @@ namespace Org.BouncyCastle.Tests inCipher = CipherUtilities.GetCipher(algorithm); outCipher = CipherUtilities.GetCipher(algorithm); -#if PORTABLE - upper = inCipher.AlgorithmName.ToUpperInvariant(); -#else upper = inCipher.AlgorithmName.ToUpper(CultureInfo.InvariantCulture); -#endif if (!upper.StartsWith(baseAlgorithm)) { Fail("wrong cipher returned!"); diff --git a/crypto/test/src/test/SP80038GTest.cs b/crypto/test/src/test/SP80038GTest.cs index 349984d9d..57c1f8c74 100644 --- a/crypto/test/src/test/SP80038GTest.cs +++ b/crypto/test/src/test/SP80038GTest.cs @@ -273,9 +273,6 @@ namespace Org.BouncyCastle.Tests private void testDisable() { -#if PORTABLE && !DOTNET - // Can't SetEnvironmentVariable ! -#else Environment.SetEnvironmentVariable("org.bouncycastle.fpe.disable", "true"); try { @@ -311,7 +308,6 @@ namespace Org.BouncyCastle.Tests testFF3_1(); Environment.SetEnvironmentVariable("org.bouncycastle.fpe.disable_ff1", "false"); -#endif } private void testFF3_1_255() diff --git a/crypto/test/src/tls/test/TlsTestUtilities.cs b/crypto/test/src/tls/test/TlsTestUtilities.cs index 0625f42f4..a3526ab6b 100644 --- a/crypto/test/src/tls/test/TlsTestUtilities.cs +++ b/crypto/test/src/tls/test/TlsTestUtilities.cs @@ -51,11 +51,7 @@ namespace Org.BouncyCastle.Tls.Tests internal static string ToUpperInvariant(string s) { -#if PORTABLE - return s.ToUpperInvariant(); -#else return s.ToUpper(CultureInfo.InvariantCulture); -#endif } internal static string Fingerprint(X509CertificateStructure c) |