Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix OperatingSystemTest.TestIsOSPlatform_MacCatalyst #84842

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Apr 14, 2023

It got broken by 3d160bc because the length assert wasn't updated. Changed the code to verify the iOS/Catalyst conditions explicitly so this doesn't happen again.

It got broken by 3d160bc because the assert wasn't updated.
Changed the code to verify the iOS/Catalyst conditions explicitly so this doesn't happen again.
@akoeplinger akoeplinger requested a review from pavelsavara April 14, 2023 15:09
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 14, 2023
@ghost ghost assigned akoeplinger Apr 14, 2023
@akoeplinger
Copy link
Member Author

/azp run runtime-maccatalyst

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@steveisok steveisok self-requested a review April 14, 2023 17:03
Assert.False(allResults[10]); // IsWasi()
for (int i = 0; i < allResults.Length; i++)
{
bool expected = (i == 4 || i == 5) ? true : false; // true for IsIOS() and IsMacCatalyst()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bool expected = (i == 4 || i == 5) ? true : false; // true for IsIOS() and IsMacCatalyst()
bool expected = i is 4 or 5; // true for IsIOS() and IsMacCatalyst()

?

Might be cleaner to change allResults to instead be a Dictionary<string,bool>, where the string is the name of the Is method. The else case could still assert that only one value was true, and this case could assert that both "IsIOS" and "IsMacCatalyst" are true and everything else is false.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated with your suggestion

@steveisok steveisok merged commit 634cc1e into dotnet:main Apr 18, 2023
@steveisok steveisok deleted the fix-catalyst-test branch April 18, 2023 16:36
@ghost ghost locked as resolved and limited conversation to collaborators May 18, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants