Skip to content

Commit a7ae080

Browse files
omaskeryOliver Maskery
andauthored
Fix panic in benches caused by missing resources (#16956)
# Objective - To fix the benches panicking on `main` ## Solution - It appears that systems requiring access to a non-existing `Res` now causes a panic - Some of the benches run systems that access resources that have not been inserted into the world - I have made it so that those resources are inserted into the world ## Testing - I ran all the ecs benches and they all run without panicking Co-authored-by: Oliver Maskery <oliver@wellplayed.games>
1 parent f966534 commit a7ae080

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

benches/benches/bevy_ecs/param/dyn_param.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub fn dyn_param(criterion: &mut Criterion) {
1414
#[derive(Resource)]
1515
struct R;
1616

17+
world.insert_resource(R);
18+
1719
let mut schedule = Schedule::default();
1820
let system = (
1921
DynParamBuilder::new::<Res<R>>(ParamBuilder),

benches/benches/bevy_ecs/param/param_set.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pub fn param_set(criterion: &mut Criterion) {
1111
#[derive(Resource)]
1212
struct R;
1313

14+
world.insert_resource(R);
15+
1416
let mut schedule = Schedule::default();
1517
schedule.add_systems(
1618
|_: ParamSet<(

0 commit comments

Comments
 (0)