File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ jobs:
199199 cargo fuzz run dictionary_round_trip -- -max_total_time=10
200200 cargo fuzz run dictionary_train -- -dict=./fuzz/dictionaries/dictionary_train.txt -max_total_time=60
201201 cargo fuzz run dictionary_train_fast -- -dict=./fuzz/dictionaries/dictionary_train.txt -max_total_time=60
202+ cargo fuzz run dictionary_train_legacy -- -dict=./fuzz/dictionaries/dictionary_train.txt -max_total_time=60
202203 env :
203204 RUSTFLAGS : " -Awarnings"
204205
Original file line number Diff line number Diff line change @@ -49,3 +49,10 @@ path = "fuzz_targets/dictionary_train_fast.rs"
4949test = false
5050doc = false
5151bench = false
52+
53+ [[bin ]]
54+ name = " dictionary_train_legacy"
55+ path = " fuzz_targets/dictionary_train_legacy.rs"
56+ test = false
57+ doc = false
58+ bench = false
Original file line number Diff line number Diff line change 1+ #![ no_main]
2+
3+ use c2rust_out_fuzz:: { assert_eq_rs_c, ArbitrarySamples } ;
4+ use libfuzzer_sys:: fuzz_target;
5+
6+ // COVER dictionary builder tests
7+ fuzz_target ! ( |samples: ArbitrarySamples | {
8+ // train
9+ assert_eq_rs_c!( {
10+ let params = libzstd_rs_sys:: ZDICT_legacy_params_t :: default ( ) ;
11+
12+ let mut dict = vec![ 0u8 ; samples. dict_size] ;
13+ let dict_size = ZDICT_trainFromBuffer_legacy (
14+ dict. as_mut_ptr( ) . cast( ) ,
15+ samples. dict_size,
16+ samples. samples. as_ptr( ) . cast( ) ,
17+ samples. sample_sizes. as_ptr( ) ,
18+ samples. nb_samples as u32 ,
19+ std:: mem:: transmute( params) ,
20+ ) ;
21+
22+ ( dict_size, dict)
23+ } ) ;
24+ } ) ;
You can’t perform that action at this time.
0 commit comments