rust-random / getrandom

A small cross-platform library for retrieving random data from (operating) system source
Apache License 2.0
264 stars 166 forks source link

Test `getrandom_uninit()` with initially-uninitialized buffer. #462

Open briansmith opened 4 weeks ago

briansmith commented 4 weeks ago

None of the tests are testing getrandom_uninit() directly, but instead it is marked as covered because getrandom() forwards to it. However, this means we're never testing an uninitialized input to getrandom_uninit(). Fix that.

briansmith commented 3 weeks ago

@josephlr @newpavlov Could we review and merge this PR, which doesn't have the MSAN-specific changes to it? I have other testing enhancements that depend on this, that I don't want to block on the MSAN stuff.

josephlr commented 3 weeks ago

@josephlr @newpavlov Could we review and merge this PR, which doesn't have the MSAN-specific changes to it? I have other testing enhancements that depend on this, that I don't want to block on the MSAN stuff.

Sorry for the delay. The testing code is currently a mess. #471 should fix things to stop relying on weird module renaming hacks. I also included the ideas form this CL into that one. If #471 looks good to you, feel free to close this.