Skip to content

4862: Remove Property Limit From PropertiesComparer#4870

Merged
OsirisTerje merged 1 commit into
nunit:mainfrom
Cincidial:Issue4862_NoLimitPropertiesComparer
Nov 3, 2024
Merged

4862: Remove Property Limit From PropertiesComparer#4870
OsirisTerje merged 1 commit into
nunit:mainfrom
Cincidial:Issue4862_NoLimitPropertiesComparer

Conversation

@Cincidial

@Cincidial Cincidial commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

Changes PropertiesComparer to use a BitArray instead of a uint (only 32 bits).

Note that in the docs for BitArray above there are 2 methods which are only available from .NET 8 and onwards. As such they can't be used here

Instead of re-implementing these methods for use in this case, I opted to use a counter to count the properties that could not use the tolerance. If re-implementing these would be preferred let me know and I can add them in as extension methods?

Tests passed locally for Windows. I don't have another OS to test on.

Fixes #4862

@manfred-brands manfred-brands 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.

@Cincidial Thanks for you contribution.

The changes look nice and simple.
I don't think it makes sense to make extension methods for the two missing methods.
These methods would have to iterate over all bits twice (All and Any) when it is simpler to maintain the count.

@OsirisTerje OsirisTerje merged commit 5f1ee6d into nunit:main Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PropertiesComparer 32 Property Limit Error Message

4 participants