forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix fuzz tests (ordinals#3416)"
This reverts commit 3de5a71.
- Loading branch information
1 parent
3de5a71
commit d1af770
Showing
19 changed files
with
651 additions
and
619 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
#![no_main] | ||
|
||
use {libfuzzer_sys::fuzz_target, ordinals::varint}; | ||
use {libfuzzer_sys::fuzz_target, ord::runes::varint}; | ||
|
||
fuzz_target!(|input: &[u8]| { | ||
let mut i = 0; | ||
|
||
while i < input.len() { | ||
let Some((decoded, length)) = varint::decode(&input[i..]) else { | ||
break; | ||
}; | ||
let (decoded, length) = varint::decode(&input[i..]); | ||
let mut encoded = Vec::new(); | ||
varint::encode_to_vec(decoded, &mut encoded); | ||
let (redecoded, redecoded_length) = varint::decode(&input[i..]).unwrap(); | ||
let (redecoded, _) = varint::decode(&input[i..]); | ||
assert_eq!(redecoded, decoded); | ||
assert_eq!(redecoded_length, length); | ||
i += length; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#![no_main] | ||
|
||
use {libfuzzer_sys::fuzz_target, ordinals::varint}; | ||
use {libfuzzer_sys::fuzz_target, ord::runes::varint}; | ||
|
||
fuzz_target!(|input: u128| { | ||
let mut encoded = Vec::new(); | ||
varint::encode_to_vec(input, &mut encoded); | ||
let (decoded, length) = varint::decode(&encoded).unwrap(); | ||
let (decoded, length) = varint::decode(&encoded); | ||
assert_eq!(length, encoded.len()); | ||
assert_eq!(decoded, input); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ use { | |
std::{ | ||
collections::HashMap, | ||
io::{BufWriter, Write}, | ||
sync::Once, | ||
sync::{Mutex, Once}, | ||
}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters