From d4f16b9d41d0a4cd6e4209a281f7d06edaae1d81 Mon Sep 17 00:00:00 2001 From: Levi Broderick Date: Tue, 14 Jul 2020 16:48:33 -0700 Subject: [PATCH] Disable most BinaryFormatter tests in wasm --- .../Collections/IEnumerable.Generic.Serialization.Tests.cs | 1 + .../Collections/IEnumerable.NonGeneric.Serialization.Tests.cs | 1 + .../Comparers/EqualityComparer.Generic.Serialization.Tests.cs | 1 + .../tests/Generic/Dictionary/Dictionary.Tests.cs | 1 + .../tests/Generic/HashSet/HashSet.Generic.Tests.cs | 1 + .../tests/BinaryFormatterTests.cs | 1 + .../tests/SerializationBinderTests.cs | 1 + .../tests/SerializationGuardTests.cs | 1 + 8 files changed, 8 insertions(+) diff --git a/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs index 55545aab907ee..908f78789b748 100644 --- a/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs +++ b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs @@ -12,6 +12,7 @@ public abstract partial class IEnumerable_Generic_Tests : TestBase { [Theory] [MemberData(nameof(ValidCollectionSizes))] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void IGenericSharedAPI_SerializeDeserialize(int count) { IEnumerable expected = GenericIEnumerableFactory(count); diff --git a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs index 77b9dbaa18069..c765af775236c 100644 --- a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs +++ b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs @@ -14,6 +14,7 @@ public abstract partial class IEnumerable_NonGeneric_Tests : TestBase { [Theory] [MemberData(nameof(ValidCollectionSizes))] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void IGenericSharedAPI_SerializeDeserialize(int count) { IEnumerable expected = NonGenericIEnumerableFactory(count); diff --git a/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs b/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs index cb58f0f4920a4..a681c794e9750 100644 --- a/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs @@ -13,6 +13,7 @@ namespace System.Collections.Generic.Tests public abstract partial class ComparersGenericTests { [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void EqualityComparer_SerializationRoundtrip() { var bf = new BinaryFormatter(); diff --git a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs index 909a36c2069a2..54e02912d2658 100644 --- a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs @@ -401,6 +401,7 @@ private static IDictionary CreateDictionary(int size, Func keyV } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void ComparerSerialization() { // Strings switch between randomized and non-randomized comparers, diff --git a/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs b/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs index eb9a920c32666..a779cad58094c 100644 --- a/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs @@ -660,6 +660,7 @@ public void Remove_NonDefaultComparer_ComparerUsed(int capacity) #region Serialization [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void ComparerSerialization() { // Strings switch between randomized and non-randomized comparers, diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs index 664f1bd9ed039..a216b33edf6d9 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs @@ -19,6 +19,7 @@ namespace System.Runtime.Serialization.Formatters.Tests { + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public partial class BinaryFormatterTests : FileCleanupTestBase { // On 32-bit we can't test these high inputs as they cause OutOfMemoryExceptions. diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs index 9e27718c99695..5ee6fab88beea 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs @@ -23,6 +23,7 @@ public void BindToName_NullDefaults() } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public void BindToType_AllValuesTracked() { var s = new MemoryStream(); diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs index d29b1b9600b02..66ae35305bb6a 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs @@ -13,6 +13,7 @@ namespace System.Runtime.Serialization.Formatters.Tests { + [PlatformSpecific(~TestPlatforms.Browser)] // BinaryFormatter not supported in browser public static class SerializationGuardTests { [Fact]