mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Integration: keep the NaN-safe .atn fuzz invariant (#7561)
The previous fix-up put main's atn fuzz target back. It compares the parsed actions with assert_eq!, so any valid file holding a NaN double fails the fuzzer falsely (NaN != NaN); the PR's own contract test nan_payloads_signed_zero_and_infinities_survive_without_false_fuzz_failures covers exactly that. The target now calls the shared check again, at its new path under tests/it/common. Co-authored-by: denstu473 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4b053e15ae
commit
5ff10e120d
1 file changed
+5
-7
@@ -1,14 +1,12 @@
|
||||
//! Fuzz the `.atn` actions parser: any input must return `Ok` or `Err`, never panic, and
|
||||
//! anything that parses must survive a write and parse back equal.
|
||||
//! anything that parses must survive writing, reparsing and stable canonical writing.
|
||||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use photocraft_psd::atn;
|
||||
|
||||
#[path = "../../tests/it/common/atn_roundtrip.rs"]
|
||||
mod atn_roundtrip;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
if let Ok(f) = atn::parse(data) {
|
||||
let bytes = atn::write(&f).expect("a parsed set is writable");
|
||||
let again = atn::parse(&bytes).expect("a written set parses");
|
||||
assert_eq!(again.actions, f.actions);
|
||||
}
|
||||
atn_roundtrip::check(data);
|
||||
});
|
||||
Reference in new issue
Block a user