diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2017-08-05 02:19:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-05 02:19:32 +0300 |
commit | b3dfe02df8dc13473afc2f739cfd0ebc3c4b3a4f (patch) | |
tree | 4baa06de6d34c44d57543c2c6c769f3e4789e327 /src | |
parent | bdb916433d3415302ca3931db3b19b7f79b04e44 (diff) | |
parent | 911782bc2e673f6aab22f8eddae26710b2eeb745 (diff) |
Merge pull request #22706 from ViktorHofer/UapaotSerialization
Reenable cloning of serializable object for uapaot
Diffstat (limited to 'src')
12 files changed, 33 insertions, 34 deletions
diff --git a/src/Common/tests/System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs b/src/Common/tests/System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs index 51383d4c6c..1582817388 100644 --- a/src/Common/tests/System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs +++ b/src/Common/tests/System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs @@ -15,10 +15,6 @@ namespace System.Runtime.Serialization.Formatters.Tests { internal static T Clone<T>(T obj) { - // https://github.com/dotnet/corefx/issues/18942 - Binary serialization still WIP on AOT platforms. - if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Native")) - return obj; - var f = new BinaryFormatter(); using (var s = new MemoryStream()) { @@ -28,18 +24,6 @@ namespace System.Runtime.Serialization.Formatters.Tests } } - internal static Lazy<T> Clone<T>(Lazy<T> lazy) - { - // https://github.com/dotnet/corefx/issues/18942 - Binary serialization still WIP on AOT platforms. - if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Native")) - { - T ignore = lazy.Value; - return lazy; - } - - return Clone<Lazy<T>>(lazy); - } - public static void AssertRoundtrips<T>(T expected, params Func<T, object>[] additionalGetters) where T : Exception { diff --git a/src/System.Collections.Specialized/tests/Resources/System.Collections.Specialized.Tests.rd.xml b/src/System.Collections.Specialized/tests/Resources/System.Collections.Specialized.Tests.rd.xml new file mode 100644 index 0000000000..8a12dcaa3e --- /dev/null +++ b/src/System.Collections.Specialized/tests/Resources/System.Collections.Specialized.Tests.rd.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" ?> +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Library Name="System.Collections.Specialized.Tests"> + <Type Name="System.Collections.Specialized.ListDictionary" BinaryFormatter="All" /> + <Type Name="System.Collections.Specialized.ListDictionary.DictionaryNode" BinaryFormatter="All" /> + <Type Name="System.Collections.Specialized.HybridDictionary" BinaryFormatter="All" /> + </Library> +</Directives> diff --git a/src/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj b/src/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj index 612db11279..2d1fe14d22 100644 --- a/src/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj +++ b/src/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj @@ -94,5 +94,8 @@ </Compile> <Compile Include="NameObjectCollectionBase\NameObjectCollectionBase.ConstructorTests.cs" /> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" /> + </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project> diff --git a/src/System.Collections/tests/ILCConfigurations.rd.xml b/src/System.Collections/tests/ILCConfigurations.rd.xml deleted file mode 100644 index 8e199216ee..0000000000 --- a/src/System.Collections/tests/ILCConfigurations.rd.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> - <Library Name="System.Collections.Tests"> - <Assembly Name="*Application*" DoNotInline="true" DoNotOptimize="true" /> - <Assembly Name="System.Collections" DoNotInline="true" DoNotOptimize="true" /> - </Library> -</Directives>
\ No newline at end of file diff --git a/src/System.Collections/tests/Resources/System.Collections.Tests.rd.xml b/src/System.Collections/tests/Resources/System.Collections.Tests.rd.xml index 7b409ae9fd..23b96d2828 100644 --- a/src/System.Collections/tests/Resources/System.Collections.Tests.rd.xml +++ b/src/System.Collections/tests/Resources/System.Collections.Tests.rd.xml @@ -1,7 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> - <Library> + <Library Name="System.Collections.Tests"> + <Assembly Name="System.Collections" BinaryFormatter="All" /> + <!-- Needed because test code calls IsSerializable on these types --> - <Type Name="System.Collections.Generic.SortedList`2" Browse="Required Public" /> - <Type Name="System.Collections.Generic.SortedDictionary`2" Browse="Required Public" /> + <Type Name="System.Collections.Generic.SortedList`2" BinaryFormatter="All" Browse="Required Public" /> + <Type Name="System.Collections.Generic.SortedDictionary`2" BinaryFormatter="All" Browse="Required Public" /> + + <Type Name="System.Collections.Generic.SortedList`2" BinaryFormatter="All" /> + <Type Name="System.Collections.ObjectModel.ReadOnlyCollection`1" BinaryFormatter="All" /> </Library> </Directives> diff --git a/src/System.Collections/tests/System.Collections.Tests.csproj b/src/System.Collections/tests/System.Collections.Tests.csproj index 0dad64f966..b78cb4f42c 100644 --- a/src/System.Collections/tests/System.Collections.Tests.csproj +++ b/src/System.Collections/tests/System.Collections.Tests.csproj @@ -2,6 +2,8 @@ <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> <PropertyGroup> + <!-- Codegen bug, VSTS tracking number 472947 --> + <ILCBuildType>chk</ILCBuildType> <ProjectGuid>{F5EB9630-AD29-4880-963F-F2D39C684D8A}</ProjectGuid> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> @@ -164,9 +166,6 @@ </Compile> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="ILCConfigurations.rd.xml" /> - </ItemGroup> - <ItemGroup> <EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> diff --git a/src/System.Net.Primitives/tests/FunctionalTests/Resources/System.Net.Primitives.Functional.Tests.rd.xml b/src/System.Net.Primitives/tests/FunctionalTests/Resources/System.Net.Primitives.Functional.Tests.rd.xml new file mode 100644 index 0000000000..6d1c95958f --- /dev/null +++ b/src/System.Net.Primitives/tests/FunctionalTests/Resources/System.Net.Primitives.Functional.Tests.rd.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" ?> +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Library Name="System.Net.Primitives.Functional.Tests"> + <Type Name="System.Net.CookieVariant" BinaryFormatter="All" /> + <Type Name="System.Net.CookieCollection" BinaryFormatter="All" /> + </Library> +</Directives> diff --git a/src/System.Net.Primitives/tests/FunctionalTests/System.Net.Primitives.Functional.Tests.csproj b/src/System.Net.Primitives/tests/FunctionalTests/System.Net.Primitives.Functional.Tests.csproj index 83b231ede5..df3aae2aeb 100644 --- a/src/System.Net.Primitives/tests/FunctionalTests/System.Net.Primitives.Functional.Tests.csproj +++ b/src/System.Net.Primitives/tests/FunctionalTests/System.Net.Primitives.Functional.Tests.csproj @@ -43,5 +43,8 @@ <Name>RemoteExecutorConsoleApp</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" /> + </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> -</Project>
\ No newline at end of file +</Project> diff --git a/src/System.ObjectModel/tests/KeyedCollection/Serialization.cs b/src/System.ObjectModel/tests/KeyedCollection/Serialization.cs index 31be8b2da1..1881e6d63c 100644 --- a/src/System.ObjectModel/tests/KeyedCollection/Serialization.cs +++ b/src/System.ObjectModel/tests/KeyedCollection/Serialization.cs @@ -19,7 +19,6 @@ namespace System.Collections.ObjectModel.Tests [Theory] [MemberData(nameof(SerializeDeserialize_Roundtrips_MemberData))] - [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Serialization still WIP in UapAot: https://github.com/dotnet/corefx/issues/18942")] public void SerializeDeserialize_Roundtrips(TestCollection c) { TestCollection clone = BinaryFormatterHelpers.Clone(c); diff --git a/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs b/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs index b47a7f303f..f823536519 100644 --- a/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs +++ b/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs @@ -20,7 +20,6 @@ namespace System.Collections.ObjectModel.Tests [Theory] [MemberData(nameof(SerializeDeserialize_Roundtrips_MemberData))] - [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Serialization still WIP in UapAot: https://github.com/dotnet/corefx/issues/18942")] public void SerializeDeserialize_Roundtrips(ObservableCollection<int> c) { ObservableCollection<int> clone = BinaryFormatterHelpers.Clone(c); diff --git a/src/System.ObjectModel/tests/ReadOnlyDictionary/ReadOnlyDictionary_SerializationTests.cs b/src/System.ObjectModel/tests/ReadOnlyDictionary/ReadOnlyDictionary_SerializationTests.cs index 97e18aaea5..9d3cad3f15 100644 --- a/src/System.ObjectModel/tests/ReadOnlyDictionary/ReadOnlyDictionary_SerializationTests.cs +++ b/src/System.ObjectModel/tests/ReadOnlyDictionary/ReadOnlyDictionary_SerializationTests.cs @@ -19,7 +19,6 @@ namespace System.Collections.ObjectModel.Tests [Theory] [MemberData(nameof(SerializeDeserialize_Roundtrips_MemberData))] - [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Serialization still WIP in UapAot: https://github.com/dotnet/corefx/issues/18942")] public void SerializeDeserialize_Roundtrips(ReadOnlyDictionary<string, string> d) { ReadOnlyDictionary<string, string> clone = BinaryFormatterHelpers.Clone(d); diff --git a/src/System.ObjectModel/tests/ReadOnlyObservableCollection/ReadOnlyObservableCollection_SerializationTests.cs b/src/System.ObjectModel/tests/ReadOnlyObservableCollection/ReadOnlyObservableCollection_SerializationTests.cs index 70c2aeb98f..2750f02740 100644 --- a/src/System.ObjectModel/tests/ReadOnlyObservableCollection/ReadOnlyObservableCollection_SerializationTests.cs +++ b/src/System.ObjectModel/tests/ReadOnlyObservableCollection/ReadOnlyObservableCollection_SerializationTests.cs @@ -20,7 +20,6 @@ namespace System.Collections.ObjectModel.Tests [Theory] [MemberData(nameof(SerializeDeserialize_Roundtrips_MemberData))] - [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Serialization still WIP in UapAot: https://github.com/dotnet/corefx/issues/18942")] public void SerializeDeserialize_Roundtrips(ReadOnlyObservableCollection<int> c) { ReadOnlyObservableCollection<int> clone = BinaryFormatterHelpers.Clone(c); |