Skip to content

2020 01 28 Rcpp test harness brainstorm

Toby Dylan Hocking edited this page Jan 29, 2020 · 1 revision

brainstorm what an Rcpp test harness might look like:

TEST(integer_Set, Ranges) {
   int data_size = DeepState_IntInRange(0,INT_MAX);
   int max_seg_size = DeepState_IntInRange(0,INT_MAX);
   Rcpp::NumericVector data_vec(data_size);
   Rcpp::IntegerVector max_segments(max_seg_size);
   for(int i=0; i<data_size; i++){
     OneOf(
	   [&] {data_vec[i] = DeepState_Double();},
	   [&] {data_vec[i] = RcppMissing();});
   }
   for(int i=0; i<max_seg_size; i++){
     max_segments[i] = DeepState_Int();
   }
   rcpp_result_gen = Rcpp::wrap(rcpp_binseg_normal(data_vec, max_segments));
}

commands for running AFL and libfuzzer (after having compiled the test harness):

deepstate-afl -i input_files -o afl_output ./testcblosc2_AFL
./testcblosc2_LF libfuzzer_output
Clone this wiki locally