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

Add CodeDom.CodeValidator tests and fix some bugs #39585

Merged
merged 3 commits into from
Sep 9, 2019
Merged

Add CodeDom.CodeValidator tests and fix some bugs #39585

merged 3 commits into from
Sep 9, 2019

Conversation

hughbe
Copy link

@hughbe hughbe commented Jul 18, 2019

No description provided.

@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
Copy link

@buyaa-n buyaa-n left a comment

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

Copy link
Member

@krwq krwq left a comment

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
Copy link
Author

hughbe commented Sep 5, 2019

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
Copy link
Member

krwq commented Sep 6, 2019

@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));
Copy link
Member

@krwq krwq Sep 9, 2019

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
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
Copy link
Member

krwq commented Sep 9, 2019

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