More HPACK bug fixes

This commit is contained in:
Carl Lerche
2017-06-12 10:39:37 -07:00
parent 58ea9ada0f
commit ef495d55dc
2 changed files with 45 additions and 15 deletions

View File

@@ -60,6 +60,13 @@ fn hpack_failing_5() {
], 101).run();
}
#[test]
fn hpack_failing_6() {
FuzzHpack::new_reduced([
7970045195656406858, 7319095306567062282, 8226114865494971289, 10649653503082373659,
], 147).run();
}
#[test]
fn hpack_fuzz() {
fn prop(fuzz: FuzzHpack) -> TestResult {
@@ -68,7 +75,7 @@ fn hpack_fuzz() {
}
QuickCheck::new()
.tests(5000)
.tests(100)
.quickcheck(prop as fn(FuzzHpack) -> TestResult)
}
@@ -90,7 +97,11 @@ struct FuzzHpack {
impl FuzzHpack {
fn new_reduced(seed: [usize; 4], i: usize) -> FuzzHpack {
let mut ret = FuzzHpack::new(seed);
ret.headers.drain(i..);
if i < ret.headers.len() {
ret.headers.drain(i..);
}
ret
}