|
93 | 93 | mutators, |
94 | 94 | initialized: Cell::new(false), |
95 | 95 | min_complexity: Cell::new(std::f64::INFINITY), |
96 | | - max_complexity: Cell::default(), |
97 | | - search_space_complexity: Cell::default(), |
| 96 | + max_complexity: Cell::new(std::f64::INFINITY), |
| 97 | + search_space_complexity: Cell::new(std::f64::INFINITY), |
98 | 98 | has_inherent_complexity: true, |
99 | 99 | inherent_complexity: Cell::default(), |
100 | 100 | _phantom: PhantomData, |
@@ -255,11 +255,12 @@ impl<T: Clone + 'static, M: Mutator<T>> Mutator<Vec<T>> for FixedLenVecMutator<T |
255 | 255 | #[no_coverage] |
256 | 256 | |cplx, m| cplx + m.global_search_space_complexity(), |
257 | 257 | ); |
258 | | - self.initialized.set(true); |
259 | 258 | self.inherent_complexity.set(inherent_complexity); |
260 | 259 | self.min_complexity.set(min_complexity); |
261 | 260 | self.max_complexity.set(max_complexity); |
262 | 261 | self.search_space_complexity.set(search_space_complexity); |
| 262 | + |
| 263 | + self.initialized.set(true); |
263 | 264 | } |
264 | 265 |
|
265 | 266 | #[doc(hidden)] |
@@ -363,6 +364,7 @@ impl<T: Clone + 'static, M: Mutator<T>> Mutator<Vec<T>> for FixedLenVecMutator<T |
363 | 364 | #[doc(hidden)] |
364 | 365 | #[no_coverage] |
365 | 366 | fn random_arbitrary(&self, max_cplx: f64) -> (Vec<T>, f64) { |
| 367 | + assert!(self.initialized.get()); |
366 | 368 | let target_cplx = crate::mutators::gen_f64(&self.rng, 1.0..max_cplx); |
367 | 369 | let (v, sum_cplx) = self.new_input_with_complexity(target_cplx); |
368 | 370 | (v, sum_cplx + self.inherent_complexity.get()) |
|
0 commit comments