Skip to content

Fix emit inconsitencies and add tests #30

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sh3Rm4n
Copy link
Contributor

@Sh3Rm4n Sh3Rm4n commented May 7, 2025

While trying to convert the parsed payload of information elements into the binary format, I've noticed inconsistencies regarding some emit implementations.

I've fixed some of them (which I needed) mostly based on the assumption, that the Parsable implementation is correct.
On exception is the Nl80211RateAndSelector implementation, where the comments from this type and Nl80211Element::SupportedRatesAndSelectors where already inconsistent.

Also I've added some roudtrip test, using macros to reduce the repetition. I thought about adding more tests, but I wanted to propose this as a starting point for now.

@cathay4t
Copy link
Member

cathay4t commented May 19, 2025

Thanks for the patch! I think it is time to add unit test by parsing and emitting captured iw netlink packets, otherwise it is just your talk vs my talk.

@cathay4t
Copy link
Member

https://github.com/rust-netlink/netlink-packet-route/?tab=readme-ov-file#development has steps to capture netlink packet. And that project also has unit test example on parsing and emitting packet.

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.

2 participants