1 use crate::hpack::{Decoder, Encoder, Header};
2 
3 use bytes::BytesMut;
4 use hex::FromHex;
5 use serde_json::Value;
6 
7 use std::fs::File;
8 use std::io::prelude::*;
9 use std::io::Cursor;
10 use std::path::Path;
11 use std::str;
12 
test_fixture(path: &Path)13 fn test_fixture(path: &Path) {
14     let mut file = File::open(path).unwrap();
15     let mut data = String::new();
16     file.read_to_string(&mut data).unwrap();
17 
18     let story: Value = serde_json::from_str(&data).unwrap();
19     test_story(story);
20 }
21 
test_story(story: Value)22 fn test_story(story: Value) {
23     let story = story.as_object().unwrap();
24 
25     if let Some(cases) = story.get("cases") {
26         let mut cases: Vec<_> = cases
27             .as_array()
28             .unwrap()
29             .iter()
30             .map(|case| {
31                 let case = case.as_object().unwrap();
32 
33                 let size = case
34                     .get("header_table_size")
35                     .map(|v| v.as_u64().unwrap() as usize);
36 
37                 let wire = case.get("wire").unwrap().as_str().unwrap();
38                 let wire: Vec<u8> = FromHex::from_hex(wire.as_bytes()).unwrap();
39 
40                 let expect: Vec<_> = case
41                     .get("headers")
42                     .unwrap()
43                     .as_array()
44                     .unwrap()
45                     .iter()
46                     .map(|h| {
47                         let h = h.as_object().unwrap();
48                         let (name, val) = h.iter().next().unwrap();
49                         (name.clone(), val.as_str().unwrap().to_string())
50                     })
51                     .collect();
52 
53                 Case {
54                     seqno: case.get("seqno").unwrap().as_u64().unwrap(),
55                     wire,
56                     expect,
57                     header_table_size: size,
58                 }
59             })
60             .collect();
61 
62         cases.sort_by_key(|c| c.seqno);
63 
64         let mut decoder = Decoder::default();
65 
66         // First, check decoding against the fixtures
67         for case in &cases {
68             let mut expect = case.expect.clone();
69 
70             if let Some(size) = case.header_table_size {
71                 decoder.queue_size_update(size);
72             }
73 
74             let mut buf = BytesMut::with_capacity(case.wire.len());
75             buf.extend_from_slice(&case.wire);
76             decoder
77                 .decode(&mut Cursor::new(&mut buf), |e| {
78                     let (name, value) = expect.remove(0);
79                     assert_eq!(name, key_str(&e));
80                     assert_eq!(value, value_str(&e));
81                 })
82                 .unwrap();
83 
84             assert_eq!(0, expect.len());
85         }
86 
87         let mut encoder = Encoder::default();
88         let mut decoder = Decoder::default();
89 
90         // Now, encode the headers
91         for case in &cases {
92             let limit = 64 * 1024;
93             let mut buf = BytesMut::with_capacity(limit);
94 
95             if let Some(size) = case.header_table_size {
96                 encoder.update_max_size(size);
97                 decoder.queue_size_update(size);
98             }
99 
100             let mut input: Vec<_> = case
101                 .expect
102                 .iter()
103                 .map(|(name, value)| {
104                     Header::new(name.clone().into(), value.clone().into())
105                         .unwrap()
106                         .into()
107                 })
108                 .collect();
109 
110             encoder.encode(&mut input.clone().into_iter(), &mut buf);
111 
112             decoder
113                 .decode(&mut Cursor::new(&mut buf), |e| {
114                     assert_eq!(e, input.remove(0).reify().unwrap());
115                 })
116                 .unwrap();
117 
118             assert_eq!(0, input.len());
119         }
120     }
121 }
122 
123 struct Case {
124     seqno: u64,
125     wire: Vec<u8>,
126     expect: Vec<(String, String)>,
127     header_table_size: Option<usize>,
128 }
129 
key_str(e: &Header) -> &str130 fn key_str(e: &Header) -> &str {
131     match *e {
132         Header::Field { ref name, .. } => name.as_str(),
133         Header::Authority(..) => ":authority",
134         Header::Method(..) => ":method",
135         Header::Scheme(..) => ":scheme",
136         Header::Path(..) => ":path",
137         Header::Protocol(..) => ":protocol",
138         Header::Status(..) => ":status",
139     }
140 }
141 
value_str(e: &Header) -> &str142 fn value_str(e: &Header) -> &str {
143     match *e {
144         Header::Field { ref value, .. } => value.to_str().unwrap(),
145         Header::Authority(ref v) => v,
146         Header::Method(ref m) => m.as_str(),
147         Header::Scheme(ref v) => v,
148         Header::Path(ref v) => v,
149         Header::Protocol(ref v) => v.as_str(),
150         Header::Status(ref v) => v.as_str(),
151     }
152 }
153 
154 macro_rules! fixture_mod {
155     ($module:ident => {
156         $(
157             ($fn:ident, $path:expr);
158         )+
159     }) => {
160         mod $module {
161             $(
162                 #[test]
163                 fn $fn() {
164                     let path = ::std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
165                         .join("fixtures/hpack")
166                         .join($path);
167 
168                     super::test_fixture(path.as_ref());
169                 }
170             )+
171         }
172     }
173 }
174 
175 fixture_mod!(
176     haskell_http2_linear_huffman => {
177         (story_00, "haskell-http2-linear-huffman/story_00.json");
178         (story_01, "haskell-http2-linear-huffman/story_01.json");
179         (story_02, "haskell-http2-linear-huffman/story_02.json");
180         (story_03, "haskell-http2-linear-huffman/story_03.json");
181         (story_04, "haskell-http2-linear-huffman/story_04.json");
182         (story_05, "haskell-http2-linear-huffman/story_05.json");
183         (story_06, "haskell-http2-linear-huffman/story_06.json");
184         (story_07, "haskell-http2-linear-huffman/story_07.json");
185         (story_08, "haskell-http2-linear-huffman/story_08.json");
186         (story_09, "haskell-http2-linear-huffman/story_09.json");
187         (story_10, "haskell-http2-linear-huffman/story_10.json");
188         (story_11, "haskell-http2-linear-huffman/story_11.json");
189         (story_12, "haskell-http2-linear-huffman/story_12.json");
190         (story_13, "haskell-http2-linear-huffman/story_13.json");
191         (story_14, "haskell-http2-linear-huffman/story_14.json");
192         (story_15, "haskell-http2-linear-huffman/story_15.json");
193         (story_16, "haskell-http2-linear-huffman/story_16.json");
194         (story_17, "haskell-http2-linear-huffman/story_17.json");
195         (story_18, "haskell-http2-linear-huffman/story_18.json");
196         (story_19, "haskell-http2-linear-huffman/story_19.json");
197         (story_20, "haskell-http2-linear-huffman/story_20.json");
198         (story_21, "haskell-http2-linear-huffman/story_21.json");
199         (story_22, "haskell-http2-linear-huffman/story_22.json");
200         (story_23, "haskell-http2-linear-huffman/story_23.json");
201         (story_24, "haskell-http2-linear-huffman/story_24.json");
202         (story_25, "haskell-http2-linear-huffman/story_25.json");
203         (story_26, "haskell-http2-linear-huffman/story_26.json");
204         (story_27, "haskell-http2-linear-huffman/story_27.json");
205         (story_28, "haskell-http2-linear-huffman/story_28.json");
206         (story_29, "haskell-http2-linear-huffman/story_29.json");
207         (story_30, "haskell-http2-linear-huffman/story_30.json");
208         (story_31, "haskell-http2-linear-huffman/story_31.json");
209     }
210 );
211 
212 fixture_mod!(
213     python_hpack => {
214         (story_00, "python-hpack/story_00.json");
215         (story_01, "python-hpack/story_01.json");
216         (story_02, "python-hpack/story_02.json");
217         (story_03, "python-hpack/story_03.json");
218         (story_04, "python-hpack/story_04.json");
219         (story_05, "python-hpack/story_05.json");
220         (story_06, "python-hpack/story_06.json");
221         (story_07, "python-hpack/story_07.json");
222         (story_08, "python-hpack/story_08.json");
223         (story_09, "python-hpack/story_09.json");
224         (story_10, "python-hpack/story_10.json");
225         (story_11, "python-hpack/story_11.json");
226         (story_12, "python-hpack/story_12.json");
227         (story_13, "python-hpack/story_13.json");
228         (story_14, "python-hpack/story_14.json");
229         (story_15, "python-hpack/story_15.json");
230         (story_16, "python-hpack/story_16.json");
231         (story_17, "python-hpack/story_17.json");
232         (story_18, "python-hpack/story_18.json");
233         (story_19, "python-hpack/story_19.json");
234         (story_20, "python-hpack/story_20.json");
235         (story_21, "python-hpack/story_21.json");
236         (story_22, "python-hpack/story_22.json");
237         (story_23, "python-hpack/story_23.json");
238         (story_24, "python-hpack/story_24.json");
239         (story_25, "python-hpack/story_25.json");
240         (story_26, "python-hpack/story_26.json");
241         (story_27, "python-hpack/story_27.json");
242         (story_28, "python-hpack/story_28.json");
243         (story_29, "python-hpack/story_29.json");
244         (story_30, "python-hpack/story_30.json");
245         (story_31, "python-hpack/story_31.json");
246     }
247 );
248 
249 fixture_mod!(
250     nghttp2_16384_4096 => {
251         (story_00, "nghttp2-16384-4096/story_00.json");
252         (story_01, "nghttp2-16384-4096/story_01.json");
253         (story_02, "nghttp2-16384-4096/story_02.json");
254         (story_03, "nghttp2-16384-4096/story_03.json");
255         (story_04, "nghttp2-16384-4096/story_04.json");
256         (story_05, "nghttp2-16384-4096/story_05.json");
257         (story_06, "nghttp2-16384-4096/story_06.json");
258         (story_07, "nghttp2-16384-4096/story_07.json");
259         (story_08, "nghttp2-16384-4096/story_08.json");
260         (story_09, "nghttp2-16384-4096/story_09.json");
261         (story_10, "nghttp2-16384-4096/story_10.json");
262         (story_11, "nghttp2-16384-4096/story_11.json");
263         (story_12, "nghttp2-16384-4096/story_12.json");
264         (story_13, "nghttp2-16384-4096/story_13.json");
265         (story_14, "nghttp2-16384-4096/story_14.json");
266         (story_15, "nghttp2-16384-4096/story_15.json");
267         (story_16, "nghttp2-16384-4096/story_16.json");
268         (story_17, "nghttp2-16384-4096/story_17.json");
269         (story_18, "nghttp2-16384-4096/story_18.json");
270         (story_19, "nghttp2-16384-4096/story_19.json");
271         (story_20, "nghttp2-16384-4096/story_20.json");
272         (story_21, "nghttp2-16384-4096/story_21.json");
273         (story_22, "nghttp2-16384-4096/story_22.json");
274         (story_23, "nghttp2-16384-4096/story_23.json");
275         (story_24, "nghttp2-16384-4096/story_24.json");
276         (story_25, "nghttp2-16384-4096/story_25.json");
277         (story_26, "nghttp2-16384-4096/story_26.json");
278         (story_27, "nghttp2-16384-4096/story_27.json");
279         (story_28, "nghttp2-16384-4096/story_28.json");
280         (story_29, "nghttp2-16384-4096/story_29.json");
281         (story_30, "nghttp2-16384-4096/story_30.json");
282     }
283 );
284 
285 fixture_mod!(
286     node_http2_hpack => {
287         (story_00, "node-http2-hpack/story_00.json");
288         (story_01, "node-http2-hpack/story_01.json");
289         (story_02, "node-http2-hpack/story_02.json");
290         (story_03, "node-http2-hpack/story_03.json");
291         (story_04, "node-http2-hpack/story_04.json");
292         (story_05, "node-http2-hpack/story_05.json");
293         (story_06, "node-http2-hpack/story_06.json");
294         (story_07, "node-http2-hpack/story_07.json");
295         (story_08, "node-http2-hpack/story_08.json");
296         (story_09, "node-http2-hpack/story_09.json");
297         (story_10, "node-http2-hpack/story_10.json");
298         (story_11, "node-http2-hpack/story_11.json");
299         (story_12, "node-http2-hpack/story_12.json");
300         (story_13, "node-http2-hpack/story_13.json");
301         (story_14, "node-http2-hpack/story_14.json");
302         (story_15, "node-http2-hpack/story_15.json");
303         (story_16, "node-http2-hpack/story_16.json");
304         (story_17, "node-http2-hpack/story_17.json");
305         (story_18, "node-http2-hpack/story_18.json");
306         (story_19, "node-http2-hpack/story_19.json");
307         (story_20, "node-http2-hpack/story_20.json");
308         (story_21, "node-http2-hpack/story_21.json");
309         (story_22, "node-http2-hpack/story_22.json");
310         (story_23, "node-http2-hpack/story_23.json");
311         (story_24, "node-http2-hpack/story_24.json");
312         (story_25, "node-http2-hpack/story_25.json");
313         (story_26, "node-http2-hpack/story_26.json");
314         (story_27, "node-http2-hpack/story_27.json");
315         (story_28, "node-http2-hpack/story_28.json");
316         (story_29, "node-http2-hpack/story_29.json");
317         (story_30, "node-http2-hpack/story_30.json");
318         (story_31, "node-http2-hpack/story_31.json");
319     }
320 );
321 
322 fixture_mod!(
323     nghttp2_change_table_size => {
324         (story_00, "nghttp2-change-table-size/story_00.json");
325         (story_01, "nghttp2-change-table-size/story_01.json");
326         (story_02, "nghttp2-change-table-size/story_02.json");
327         (story_03, "nghttp2-change-table-size/story_03.json");
328         (story_04, "nghttp2-change-table-size/story_04.json");
329         (story_05, "nghttp2-change-table-size/story_05.json");
330         (story_06, "nghttp2-change-table-size/story_06.json");
331         (story_07, "nghttp2-change-table-size/story_07.json");
332         (story_08, "nghttp2-change-table-size/story_08.json");
333         (story_09, "nghttp2-change-table-size/story_09.json");
334         (story_10, "nghttp2-change-table-size/story_10.json");
335         (story_11, "nghttp2-change-table-size/story_11.json");
336         (story_12, "nghttp2-change-table-size/story_12.json");
337         (story_13, "nghttp2-change-table-size/story_13.json");
338         (story_14, "nghttp2-change-table-size/story_14.json");
339         (story_15, "nghttp2-change-table-size/story_15.json");
340         (story_16, "nghttp2-change-table-size/story_16.json");
341         (story_17, "nghttp2-change-table-size/story_17.json");
342         (story_18, "nghttp2-change-table-size/story_18.json");
343         (story_19, "nghttp2-change-table-size/story_19.json");
344         (story_20, "nghttp2-change-table-size/story_20.json");
345         (story_21, "nghttp2-change-table-size/story_21.json");
346         (story_22, "nghttp2-change-table-size/story_22.json");
347         (story_23, "nghttp2-change-table-size/story_23.json");
348         (story_24, "nghttp2-change-table-size/story_24.json");
349         (story_25, "nghttp2-change-table-size/story_25.json");
350         (story_26, "nghttp2-change-table-size/story_26.json");
351         (story_27, "nghttp2-change-table-size/story_27.json");
352         (story_28, "nghttp2-change-table-size/story_28.json");
353         (story_29, "nghttp2-change-table-size/story_29.json");
354         (story_30, "nghttp2-change-table-size/story_30.json");
355     }
356 );
357 
358 fixture_mod!(
359     haskell_http2_static_huffman => {
360         (story_00, "haskell-http2-static-huffman/story_00.json");
361         (story_01, "haskell-http2-static-huffman/story_01.json");
362         (story_02, "haskell-http2-static-huffman/story_02.json");
363         (story_03, "haskell-http2-static-huffman/story_03.json");
364         (story_04, "haskell-http2-static-huffman/story_04.json");
365         (story_05, "haskell-http2-static-huffman/story_05.json");
366         (story_06, "haskell-http2-static-huffman/story_06.json");
367         (story_07, "haskell-http2-static-huffman/story_07.json");
368         (story_08, "haskell-http2-static-huffman/story_08.json");
369         (story_09, "haskell-http2-static-huffman/story_09.json");
370         (story_10, "haskell-http2-static-huffman/story_10.json");
371         (story_11, "haskell-http2-static-huffman/story_11.json");
372         (story_12, "haskell-http2-static-huffman/story_12.json");
373         (story_13, "haskell-http2-static-huffman/story_13.json");
374         (story_14, "haskell-http2-static-huffman/story_14.json");
375         (story_15, "haskell-http2-static-huffman/story_15.json");
376         (story_16, "haskell-http2-static-huffman/story_16.json");
377         (story_17, "haskell-http2-static-huffman/story_17.json");
378         (story_18, "haskell-http2-static-huffman/story_18.json");
379         (story_19, "haskell-http2-static-huffman/story_19.json");
380         (story_20, "haskell-http2-static-huffman/story_20.json");
381         (story_21, "haskell-http2-static-huffman/story_21.json");
382         (story_22, "haskell-http2-static-huffman/story_22.json");
383         (story_23, "haskell-http2-static-huffman/story_23.json");
384         (story_24, "haskell-http2-static-huffman/story_24.json");
385         (story_25, "haskell-http2-static-huffman/story_25.json");
386         (story_26, "haskell-http2-static-huffman/story_26.json");
387         (story_27, "haskell-http2-static-huffman/story_27.json");
388         (story_28, "haskell-http2-static-huffman/story_28.json");
389         (story_29, "haskell-http2-static-huffman/story_29.json");
390         (story_30, "haskell-http2-static-huffman/story_30.json");
391         (story_31, "haskell-http2-static-huffman/story_31.json");
392     }
393 );
394 
395 fixture_mod!(
396     haskell_http2_naive_huffman => {
397         (story_00, "haskell-http2-naive-huffman/story_00.json");
398         (story_01, "haskell-http2-naive-huffman/story_01.json");
399         (story_02, "haskell-http2-naive-huffman/story_02.json");
400         (story_03, "haskell-http2-naive-huffman/story_03.json");
401         (story_04, "haskell-http2-naive-huffman/story_04.json");
402         (story_05, "haskell-http2-naive-huffman/story_05.json");
403         (story_06, "haskell-http2-naive-huffman/story_06.json");
404         (story_07, "haskell-http2-naive-huffman/story_07.json");
405         (story_08, "haskell-http2-naive-huffman/story_08.json");
406         (story_09, "haskell-http2-naive-huffman/story_09.json");
407         (story_10, "haskell-http2-naive-huffman/story_10.json");
408         (story_11, "haskell-http2-naive-huffman/story_11.json");
409         (story_12, "haskell-http2-naive-huffman/story_12.json");
410         (story_13, "haskell-http2-naive-huffman/story_13.json");
411         (story_14, "haskell-http2-naive-huffman/story_14.json");
412         (story_15, "haskell-http2-naive-huffman/story_15.json");
413         (story_16, "haskell-http2-naive-huffman/story_16.json");
414         (story_17, "haskell-http2-naive-huffman/story_17.json");
415         (story_18, "haskell-http2-naive-huffman/story_18.json");
416         (story_19, "haskell-http2-naive-huffman/story_19.json");
417         (story_20, "haskell-http2-naive-huffman/story_20.json");
418         (story_21, "haskell-http2-naive-huffman/story_21.json");
419         (story_22, "haskell-http2-naive-huffman/story_22.json");
420         (story_23, "haskell-http2-naive-huffman/story_23.json");
421         (story_24, "haskell-http2-naive-huffman/story_24.json");
422         (story_25, "haskell-http2-naive-huffman/story_25.json");
423         (story_26, "haskell-http2-naive-huffman/story_26.json");
424         (story_27, "haskell-http2-naive-huffman/story_27.json");
425         (story_28, "haskell-http2-naive-huffman/story_28.json");
426         (story_29, "haskell-http2-naive-huffman/story_29.json");
427         (story_30, "haskell-http2-naive-huffman/story_30.json");
428         (story_31, "haskell-http2-naive-huffman/story_31.json");
429     }
430 );
431 
432 fixture_mod!(
433     haskell_http2_naive => {
434         (story_00, "haskell-http2-naive/story_00.json");
435         (story_01, "haskell-http2-naive/story_01.json");
436         (story_02, "haskell-http2-naive/story_02.json");
437         (story_03, "haskell-http2-naive/story_03.json");
438         (story_04, "haskell-http2-naive/story_04.json");
439         (story_05, "haskell-http2-naive/story_05.json");
440         (story_06, "haskell-http2-naive/story_06.json");
441         (story_07, "haskell-http2-naive/story_07.json");
442         (story_08, "haskell-http2-naive/story_08.json");
443         (story_09, "haskell-http2-naive/story_09.json");
444         (story_10, "haskell-http2-naive/story_10.json");
445         (story_11, "haskell-http2-naive/story_11.json");
446         (story_12, "haskell-http2-naive/story_12.json");
447         (story_13, "haskell-http2-naive/story_13.json");
448         (story_14, "haskell-http2-naive/story_14.json");
449         (story_15, "haskell-http2-naive/story_15.json");
450         (story_16, "haskell-http2-naive/story_16.json");
451         (story_17, "haskell-http2-naive/story_17.json");
452         (story_18, "haskell-http2-naive/story_18.json");
453         (story_19, "haskell-http2-naive/story_19.json");
454         (story_20, "haskell-http2-naive/story_20.json");
455         (story_21, "haskell-http2-naive/story_21.json");
456         (story_22, "haskell-http2-naive/story_22.json");
457         (story_23, "haskell-http2-naive/story_23.json");
458         (story_24, "haskell-http2-naive/story_24.json");
459         (story_25, "haskell-http2-naive/story_25.json");
460         (story_26, "haskell-http2-naive/story_26.json");
461         (story_27, "haskell-http2-naive/story_27.json");
462         (story_28, "haskell-http2-naive/story_28.json");
463         (story_29, "haskell-http2-naive/story_29.json");
464         (story_30, "haskell-http2-naive/story_30.json");
465         (story_31, "haskell-http2-naive/story_31.json");
466     }
467 );
468 
469 fixture_mod!(
470     haskell_http2_static => {
471         (story_00, "haskell-http2-static/story_00.json");
472         (story_01, "haskell-http2-static/story_01.json");
473         (story_02, "haskell-http2-static/story_02.json");
474         (story_03, "haskell-http2-static/story_03.json");
475         (story_04, "haskell-http2-static/story_04.json");
476         (story_05, "haskell-http2-static/story_05.json");
477         (story_06, "haskell-http2-static/story_06.json");
478         (story_07, "haskell-http2-static/story_07.json");
479         (story_08, "haskell-http2-static/story_08.json");
480         (story_09, "haskell-http2-static/story_09.json");
481         (story_10, "haskell-http2-static/story_10.json");
482         (story_11, "haskell-http2-static/story_11.json");
483         (story_12, "haskell-http2-static/story_12.json");
484         (story_13, "haskell-http2-static/story_13.json");
485         (story_14, "haskell-http2-static/story_14.json");
486         (story_15, "haskell-http2-static/story_15.json");
487         (story_16, "haskell-http2-static/story_16.json");
488         (story_17, "haskell-http2-static/story_17.json");
489         (story_18, "haskell-http2-static/story_18.json");
490         (story_19, "haskell-http2-static/story_19.json");
491         (story_20, "haskell-http2-static/story_20.json");
492         (story_21, "haskell-http2-static/story_21.json");
493         (story_22, "haskell-http2-static/story_22.json");
494         (story_23, "haskell-http2-static/story_23.json");
495         (story_24, "haskell-http2-static/story_24.json");
496         (story_25, "haskell-http2-static/story_25.json");
497         (story_26, "haskell-http2-static/story_26.json");
498         (story_27, "haskell-http2-static/story_27.json");
499         (story_28, "haskell-http2-static/story_28.json");
500         (story_29, "haskell-http2-static/story_29.json");
501         (story_30, "haskell-http2-static/story_30.json");
502         (story_31, "haskell-http2-static/story_31.json");
503     }
504 );
505 
506 fixture_mod!(
507     nghttp2 => {
508         (story_00, "nghttp2/story_00.json");
509         (story_01, "nghttp2/story_01.json");
510         (story_02, "nghttp2/story_02.json");
511         (story_03, "nghttp2/story_03.json");
512         (story_04, "nghttp2/story_04.json");
513         (story_05, "nghttp2/story_05.json");
514         (story_06, "nghttp2/story_06.json");
515         (story_07, "nghttp2/story_07.json");
516         (story_08, "nghttp2/story_08.json");
517         (story_09, "nghttp2/story_09.json");
518         (story_10, "nghttp2/story_10.json");
519         (story_11, "nghttp2/story_11.json");
520         (story_12, "nghttp2/story_12.json");
521         (story_13, "nghttp2/story_13.json");
522         (story_14, "nghttp2/story_14.json");
523         (story_15, "nghttp2/story_15.json");
524         (story_16, "nghttp2/story_16.json");
525         (story_17, "nghttp2/story_17.json");
526         (story_18, "nghttp2/story_18.json");
527         (story_19, "nghttp2/story_19.json");
528         (story_20, "nghttp2/story_20.json");
529         (story_21, "nghttp2/story_21.json");
530         (story_22, "nghttp2/story_22.json");
531         (story_23, "nghttp2/story_23.json");
532         (story_24, "nghttp2/story_24.json");
533         (story_25, "nghttp2/story_25.json");
534         (story_26, "nghttp2/story_26.json");
535         (story_27, "nghttp2/story_27.json");
536         (story_28, "nghttp2/story_28.json");
537         (story_29, "nghttp2/story_29.json");
538         (story_30, "nghttp2/story_30.json");
539         (story_31, "nghttp2/story_31.json");
540     }
541 );
542 
543 fixture_mod!(
544     haskell_http2_linear => {
545         (story_00, "haskell-http2-linear/story_00.json");
546         (story_01, "haskell-http2-linear/story_01.json");
547         (story_02, "haskell-http2-linear/story_02.json");
548         (story_03, "haskell-http2-linear/story_03.json");
549         (story_04, "haskell-http2-linear/story_04.json");
550         (story_05, "haskell-http2-linear/story_05.json");
551         (story_06, "haskell-http2-linear/story_06.json");
552         (story_07, "haskell-http2-linear/story_07.json");
553         (story_08, "haskell-http2-linear/story_08.json");
554         (story_09, "haskell-http2-linear/story_09.json");
555         (story_10, "haskell-http2-linear/story_10.json");
556         (story_11, "haskell-http2-linear/story_11.json");
557         (story_12, "haskell-http2-linear/story_12.json");
558         (story_13, "haskell-http2-linear/story_13.json");
559         (story_14, "haskell-http2-linear/story_14.json");
560         (story_15, "haskell-http2-linear/story_15.json");
561         (story_16, "haskell-http2-linear/story_16.json");
562         (story_17, "haskell-http2-linear/story_17.json");
563         (story_18, "haskell-http2-linear/story_18.json");
564         (story_19, "haskell-http2-linear/story_19.json");
565         (story_20, "haskell-http2-linear/story_20.json");
566         (story_21, "haskell-http2-linear/story_21.json");
567         (story_22, "haskell-http2-linear/story_22.json");
568         (story_23, "haskell-http2-linear/story_23.json");
569         (story_24, "haskell-http2-linear/story_24.json");
570         (story_25, "haskell-http2-linear/story_25.json");
571         (story_26, "haskell-http2-linear/story_26.json");
572         (story_27, "haskell-http2-linear/story_27.json");
573         (story_28, "haskell-http2-linear/story_28.json");
574         (story_29, "haskell-http2-linear/story_29.json");
575         (story_30, "haskell-http2-linear/story_30.json");
576         (story_31, "haskell-http2-linear/story_31.json");
577     }
578 );
579 
580 fixture_mod!(
581     go_hpack => {
582         (story_00, "go-hpack/story_00.json");
583         (story_01, "go-hpack/story_01.json");
584         (story_02, "go-hpack/story_02.json");
585         (story_03, "go-hpack/story_03.json");
586         (story_04, "go-hpack/story_04.json");
587         (story_05, "go-hpack/story_05.json");
588         (story_06, "go-hpack/story_06.json");
589         (story_07, "go-hpack/story_07.json");
590         (story_08, "go-hpack/story_08.json");
591         (story_09, "go-hpack/story_09.json");
592         (story_10, "go-hpack/story_10.json");
593         (story_11, "go-hpack/story_11.json");
594         (story_12, "go-hpack/story_12.json");
595         (story_13, "go-hpack/story_13.json");
596         (story_14, "go-hpack/story_14.json");
597         (story_15, "go-hpack/story_15.json");
598         (story_16, "go-hpack/story_16.json");
599         (story_17, "go-hpack/story_17.json");
600         (story_18, "go-hpack/story_18.json");
601         (story_19, "go-hpack/story_19.json");
602         (story_20, "go-hpack/story_20.json");
603         (story_21, "go-hpack/story_21.json");
604         (story_22, "go-hpack/story_22.json");
605         (story_23, "go-hpack/story_23.json");
606         (story_24, "go-hpack/story_24.json");
607         (story_25, "go-hpack/story_25.json");
608         (story_26, "go-hpack/story_26.json");
609         (story_27, "go-hpack/story_27.json");
610         (story_28, "go-hpack/story_28.json");
611         (story_29, "go-hpack/story_29.json");
612         (story_30, "go-hpack/story_30.json");
613         (story_31, "go-hpack/story_31.json");
614     }
615 );
616