summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-11-18 02:46:59 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-11-18 02:46:59 +0000
commit920ec361417d68836ba13bf4715639a526b65490 (patch)
treed5eed110b002f26079b9fb30505418f277272845
parent2d0a91eb18cfaaa92a5fdde87cc969a9f2c21656 (diff)
downloadgentoo-utils-920ec361417d68836ba13bf4715639a526b65490.tar.gz
skip atoms that portage denies for having duplicate usedeps
-rw-r--r--fuzz/fuzz.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/fuzz/fuzz.rs b/fuzz/fuzz.rs
index 4e48f1d..610e08b 100644
--- a/fuzz/fuzz.rs
+++ b/fuzz/fuzz.rs
@@ -68,19 +68,30 @@ pub unsafe extern "C" fn LLVMFuzzerTestOneInput(input: *const u8, len: usize) ->
result => panic!("got unexpected result from python: {result}"),
};
- let gentoo_utils_result = Atom::parser().check_finished(InputIter::new(atom)).is_ok();
+ let gentoo_utils_result = Atom::parser().parse_finished(InputIter::new(atom));
match (portage_result, gentoo_utils_result) {
- (true, true) => {
+ (true, Ok(_)) => {
eprintln!("agreement that {atom} is valid");
}
- (false, false) => {
+ (false, Err(_)) => {
eprintln!("agreement that {atom} is invalid");
}
- (true, false) => {
+ (true, Err(_)) => {
panic!("rejected valid atom: {atom}");
}
- (false, true) => {
+ (false, Ok(atom))
+ if atom.usedeps().iter().any(|usedep| {
+ atom.usedeps()
+ .iter()
+ .filter(|u| usedep.flag() == u.flag())
+ .count()
+ > 1
+ }) =>
+ {
+ eprintln!("disagreement due to duplicates in usedeps");
+ }
+ (false, Ok(_)) => {
panic!("accpeted invalid atom: {atom}")
}
}