Mercurial > crates > nonstick
comparison libpam-sys/libpam-sys-test/tests/runner.rs @ 139:33b9622ed6d2
Remove redundant memory management in nonstick::libpam; fix UB.
- Uses the libpam-sys-helpers BinaryPayload / OwnedBinaryPayload structs
to handle memory management and parsing for Linux-PAM binary messages.
- Gets rid of the (technically) undefined behavior in PtrPtrVec
due to pointer provenance.
- Don't check for malloc failing. It won't, even if it does.
- Formatting/cleanups/etc.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Thu, 03 Jul 2025 23:57:49 -0400 |
parents | 88627c057709 |
children |
comparison
equal
deleted
inserted
replaced
138:999bf07efbcb | 139:33b9622ed6d2 |
---|---|
4 ($file:literal) => { | 4 ($file:literal) => { |
5 include!(concat!(env!("OUT_DIR"), "/", $file)); | 5 include!(concat!(env!("OUT_DIR"), "/", $file)); |
6 }; | 6 }; |
7 } | 7 } |
8 | 8 |
9 #[allow( | |
10 dead_code, | |
11 non_camel_case_types, | |
12 non_upper_case_globals, | |
13 clippy::unnecessary_cast | |
14 )] | |
9 mod constants { | 15 mod constants { |
10 #[allow(dead_code, non_camel_case_types, non_upper_case_globals)] | |
11 mod generated { | 16 mod generated { |
12 include_test!("bindgen.rs"); | 17 include_test!("bindgen.rs"); |
13 } | 18 } |
14 | 19 |
15 include_test!("constant_test.rs"); | 20 include_test!("constant_test.rs"); |
18 fn test_constants() { | 23 fn test_constants() { |
19 main() | 24 main() |
20 } | 25 } |
21 } | 26 } |
22 | 27 |
23 #[allow(clippy::all)] | 28 #[allow( |
29 clippy::disallowed_names, | |
30 clippy::needless_range_loop, | |
31 clippy::nonminimal_bool | |
32 )] | |
24 mod ctest { | 33 mod ctest { |
25 use libc::*; | 34 use libc::*; |
26 use libpam_sys::*; | 35 use libpam_sys::*; |
27 include_test!("ctest.rs"); | 36 include_test!("ctest.rs"); |
28 | 37 |
29 #[test] | 38 #[test] |
39 #[cfg_attr(miri, ignore)] | |
30 fn test_c() { | 40 fn test_c() { |
31 main(); | 41 main(); |
32 } | 42 } |
33 } | 43 } |