Run tests with features on rather then off (#12567)
This commit is contained in:
parent
90714941b7
commit
575400c83f
|
@ -887,7 +887,7 @@ mod tests {
|
|||
&hash_queue,
|
||||
error_counters,
|
||||
rent_collector,
|
||||
&FeatureSet::default(),
|
||||
&FeatureSet::all_enabled(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1832,7 +1832,7 @@ mod tests {
|
|||
&hash_queue,
|
||||
&mut error_counters,
|
||||
&rent_collector,
|
||||
&FeatureSet::default(),
|
||||
&FeatureSet::all_enabled(),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -67,13 +67,6 @@ pub struct FeatureSet {
|
|||
pub active: HashSet<Pubkey>,
|
||||
pub inactive: HashSet<Pubkey>,
|
||||
}
|
||||
|
||||
impl FeatureSet {
|
||||
pub fn is_active(&self, feature_id: &Pubkey) -> bool {
|
||||
self.active.contains(feature_id)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for FeatureSet {
|
||||
fn default() -> Self {
|
||||
// All features disabled
|
||||
|
@ -83,3 +76,15 @@ impl Default for FeatureSet {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl FeatureSet {
|
||||
pub fn is_active(&self, feature_id: &Pubkey) -> bool {
|
||||
self.active.contains(feature_id)
|
||||
}
|
||||
/// All features enabled, useful for testing
|
||||
pub fn all_enabled() -> Self {
|
||||
Self {
|
||||
active: FEATURE_NAMES.keys().cloned().collect(),
|
||||
inactive: HashSet::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -789,7 +789,7 @@ mod tests {
|
|||
ComputeBudget::default(),
|
||||
Rc::new(RefCell::new(Executors::default())),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
|
||||
// Check call depth increases and has a limit
|
||||
|
@ -1326,7 +1326,7 @@ mod tests {
|
|||
None,
|
||||
executors.clone(),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(result, Ok(()));
|
||||
assert_eq!(accounts[0].borrow().lamports, 100);
|
||||
|
@ -1349,7 +1349,7 @@ mod tests {
|
|||
None,
|
||||
executors.clone(),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(
|
||||
result,
|
||||
|
@ -1376,7 +1376,7 @@ mod tests {
|
|||
None,
|
||||
executors,
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(
|
||||
result,
|
||||
|
@ -1486,7 +1486,7 @@ mod tests {
|
|||
None,
|
||||
executors.clone(),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(
|
||||
result,
|
||||
|
@ -1513,7 +1513,7 @@ mod tests {
|
|||
None,
|
||||
executors.clone(),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(result, Ok(()));
|
||||
|
||||
|
@ -1537,7 +1537,7 @@ mod tests {
|
|||
None,
|
||||
executors,
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
assert_eq!(result, Ok(()));
|
||||
assert_eq!(accounts[0].borrow().lamports, 80);
|
||||
|
@ -1614,7 +1614,7 @@ mod tests {
|
|||
ComputeBudget::default(),
|
||||
Rc::new(RefCell::new(Executors::default())),
|
||||
None,
|
||||
Arc::new(FeatureSet::default()),
|
||||
Arc::new(FeatureSet::all_enabled()),
|
||||
);
|
||||
let metas = vec![
|
||||
AccountMeta::new(owned_key, false),
|
||||
|
|
Loading…
Reference in New Issue