Skip to content

Fix(Asn1Utils): Make is_bit_set Independent Of The Order Of The Names - #116

Open
misiektoja wants to merge 2 commits into
siemens:mainfrom
misiektoja:fix/is-bit-set-name-order
Open

misiektoja wants to merge 2 commits into
siemens:mainfrom
misiektoja:fix/is-bit-set-name-order

Conversation

@misiektoja

Copy link
Copy Markdown
Contributor

Description

is_bit_set now compares the set bit names with the given names as sets, so the order of the names no longer matters. The docstring and every other result stay the same.

Motivation and Context

With exclusive=True and all listed bits set, the result depended on the order: badRequest,badDataFormat passed and badDataFormat,badRequest failed. Four calls in tests/ list their bits out of bit order, for example transactionIdInUse,badRequest. Follow-up to the discussion in #107.

How Has This Been Tested?

A new unit test checks both orders with and without exclusive. It fails on main and passes with this change. A second test checks that names that differ from the set bits still fail with exclusive=True in either order. Other unit test results match main. Python 3.15 with pytest 9.2.

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.

1 participant