-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable more BinaryFormatter tests #107408
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
bb3475e
enable the BinaryFormatter tests in System.Runtime.Serialization.Form…
adamsitnik f8dc5f9
add new test project, where the flag is disabled and it runs only 3 t…
adamsitnik 51e9e17
The SerializationGuard is no longer activated since BF was moved to t…
adamsitnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...n.Formatters/tests/Disabled/System.Runtime.Serialization.Formatters.Disabled.Tests.csproj
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,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TestRuntime>true</TestRuntime> | ||
<IncludeRemoteExecutor>true</IncludeRemoteExecutor> | ||
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-freebsd;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-solaris;$(NetCoreAppCurrent)-haiku;$(NetCoreAppCurrent)-linux;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-ios;$(NetCoreAppCurrent)-tvos</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="DisableBitTests.cs" /> | ||
<Compile Include="..\TestConfiguration.cs" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Serialization.Formatters\src\System.Runtime.Serialization.Formatters.csproj" /> | ||
</ItemGroup> | ||
<!-- | ||
We're testing the BinaryFormatter enablement / disablement switch, so we need to suppress any inherited behavior. | ||
See https://github.com/dotnet/runtime/issues/87811 for more details. | ||
This is a temporary solution and should be reverted back to the original once the necessary changes are made in | ||
shared frameworks and SDK. | ||
--> | ||
<Target Name="RemoveSerializationRuntimeOption" BeforeTargets="GenerateBuildRuntimeConfigurationFiles"> | ||
<ItemGroup> | ||
<RuntimeHostConfigurationOption Remove="System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
105 changes: 10 additions & 95 deletions
105
src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far the test was trying to start calc:
runtime/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs
Lines 75 to 78 in 4a17f04
and just asserting that deserialization was failing with
SerializationException
:runtime/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs
Line 50 in 4a17f04
I decided to just call
SerializationGuard.ThrowIfDeserializationInProgress
here. I expect that it's going to do the job without having any side-effects.I could have just deleted those tests, but then it would not be explicit that it's not something that we want.