Rewrap all comments to 100 line width (#9490)

* reformat everything again

* manual formatting

* last manual fix

* Fix build
This commit is contained in:
Kian Paimani
2021-08-11 16:56:55 +02:00
committed by GitHub
parent 8180c58700
commit abd08e29ce
258 changed files with 1776 additions and 1447 deletions
@@ -12,18 +12,20 @@ fn main() {
fuzz!(|fuzzer_data: &[u8]| {
let result_decoded: Result<InnerTestSolutionCompact, Error> =
<InnerTestSolutionCompact as codec::Decode>::decode(&mut &fuzzer_data[..]);
// Ignore errors as not every random sequence of bytes can be decoded as InnerTestSolutionCompact
// Ignore errors as not every random sequence of bytes can be decoded as
// InnerTestSolutionCompact
if let Ok(decoded) = result_decoded {
// Decoding works, let's re-encode it and compare results.
let reencoded: std::vec::Vec<u8> = decoded.encode();
// The reencoded value may or may not be equal to the original fuzzer output. However, the
// original decoder should be optimal (in the sense that there is no shorter encoding of
// the same object). So let's see if the fuzzer can find something shorter:
// The reencoded value may or may not be equal to the original fuzzer output.
// However, the original decoder should be optimal (in the sense that there is no
// shorter encoding of the same object). So let's see if the fuzzer can find
// something shorter:
if fuzzer_data.len() < reencoded.len() {
panic!("fuzzer_data.len() < reencoded.len()");
}
// The reencoded value should definitely be decodable (if unwrap() fails that is a valid
// panic/finding for the fuzzer):
// The reencoded value should definitely be decodable (if unwrap() fails that is a
// valid panic/finding for the fuzzer):
let decoded2: InnerTestSolutionCompact =
<InnerTestSolutionCompact as codec::Decode>::decode(&mut reencoded.as_slice())
.unwrap();
@@ -94,8 +94,8 @@ fn main() {
iterations, unbalanced_score, balanced_score, enhance,
);
// The only guarantee of balancing is such that the first and third element of the score
// cannot decrease.
// The only guarantee of balancing is such that the first and third element of the
// score cannot decrease.
assert!(
balanced_score[0] >= unbalanced_score[0] &&
balanced_score[1] == unbalanced_score[1] &&
@@ -21,17 +21,17 @@
//! ## Running a single iteration
//!
//! Honggfuzz shuts down each individual loop iteration after a configurable time limit.
//! It can be helpful to run a single iteration on your hardware to help benchmark how long that time
//! limit should reasonably be. Simply run the program without the `fuzzing` configuration to run a
//! single iteration: `cargo run --bin phragmen_pjr`.
//! It can be helpful to run a single iteration on your hardware to help benchmark how long that
//! time limit should reasonably be. Simply run the program without the `fuzzing` configuration to
//! run a single iteration: `cargo run --bin phragmen_pjr`.
//!
//! ## Running
//!
//! Run with `HFUZZ_RUN_ARGS="-t 10" cargo hfuzz run phragmen_pjr`.
//!
//! Note the environment variable: by default, `cargo hfuzz` shuts down each iteration after 1 second
//! of runtime. We significantly increase that to ensure that the fuzzing gets a chance to complete.
//! Running a single iteration can help determine an appropriate value for this parameter.
//! Note the environment variable: by default, `cargo hfuzz` shuts down each iteration after 1
//! second of runtime. We significantly increase that to ensure that the fuzzing gets a chance to
//! complete. Running a single iteration can help determine an appropriate value for this parameter.
//!
//! ## Debugging a panic
//!