Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add CodeDom.CodeValidator tests and fix some bugs - #39585

Merged
krwq merged 3 commits into
dotnet:masterfrom
hughbe:codevalidator-tests
Sep 9, 2019
Merged

krwq merged 3 commits into
dotnet:masterfrom
hughbe:codevalidator-tests

Conversation

@hughbe

@hughbe hughbe commented Jul 18, 2019

Copy link
Copy Markdown

No description provided.

Comment thread src/Common/src/System/CSharpHelpers.cs
Comment thread src/System.CodeDom/src/System/CodeDom/Compiler/CodeValidator.cs
@karelz karelz added this to the 5.0 milestone Aug 3, 2019
@danmoseley
danmoseley requested a review from buyaa-n August 6, 2019 21:56
@maryamariyan
maryamariyan requested review from maryamariyan and removed request for maryamariyan August 8, 2019 08:17
Comment thread src/System.CodeDom/tests/System/CodeDom/Compiler/CodeDomProviderTests.cs Outdated

@buyaa-n buyaa-n left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small question, overall looks good

Comment thread src/System.CodeDom/tests/System/CodeDom/Compiler/CodeDomProviderTests.cs Outdated

@krwq krwq left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please fix the exception comment

@hughbe

hughbe commented Sep 5, 2019

Copy link
Copy Markdown
Author

Would be great to get this merged. I've written loads of other CodeDom tests (aiming for 100% code coverage woo!) that depend on this PR

@krwq

krwq commented Sep 6, 2019

Copy link
Copy Markdown
Member

@hughbe new changes LGTM, you will need to disable/fixup tests so that full framework also passes

// Because CodeDomProvider.CreateProvider(string.Empty) throws an internal ConfigurationErrorsException,
// rather than the publically exposed exception, we need to call BinaryFormatterHelpers.AssertExceptionDeserializationFails
// through reflection.
MethodInfo method = typeof(BinaryFormatterHelpers).GetMethod(nameof(BinaryFormatterHelpers.AssertExceptionDeserializationFails));

@krwq krwq Sep 9, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add new overload to BinaryFormatterHelpers which takes Type to avoid reflection? (current one can call it since it's doing typeof(T) anyway)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’d have to do the same reflection jazz in that method in BinaryFormatter. I actually don’t think it would be really that useful. Mainly because this is the only case IIRC where we catch and validate an internal exception thrown from public API

@krwq
krwq merged commit 50e8db3 into dotnet:master Sep 9, 2019
@krwq

krwq commented Sep 9, 2019

Copy link
Copy Markdown
Member

Thanks @hughbe!

@hughbe
hughbe deleted the codevalidator-tests branch September 9, 2019 23:34
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Add CodeDom.CodeValidator tests and fix some bugs

* Fix netfx tests

* PR feedback


Commit migrated from dotnet/corefx@50e8db3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants