flybywiresim / aircraft

The A32NX & A380X Project are community driven open source projects to create free Airbus aircraft in Microsoft Flight Simulator that are as close to reality as possible.
https://flybywiresim.com
GNU General Public License v3.0
4.99k stars 1.04k forks source link

rust: pneumatic testbed setup deprecated #8608

Open tracernz opened 6 months ago

tracernz commented 6 months ago

Aircraft Version

Development

Description

Needs setup to use the new method. Good first issue for rust enthusiasts.

warning: use of deprecated associated function `simulation::update_context::UpdateContext::new`: Do not create UpdateContext directly. Instead use the SimulationTestBed or your own custom test bed.
   --> fbw-common/src/wasm/systems/systems/src/pneumatic/valve.rs:671:24
    |
671 |         UpdateContext::new(
    |                        ^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `simulation::update_context::UpdateContext::new`: Do not create UpdateContext directly. Instead use the SimulationTestBed or your own custom test bed.
    --> fbw-common/src/wasm/systems/systems/src/pneumatic/mod.rs:1038:24
     |
1038 |         UpdateContext::new(
     |                        ^^^

References (optional)

No response

Additional info (optional)

No response

Discord Username (optional)

No response

Aditya13s commented 5 months ago

Please assign me I am working on it. @tracernz

Aditya13s commented 5 months ago

@tracernz can you tell me what I need to do in it?

2hwk commented 5 months ago

See some other examples in hydraulic, air conditioning test.rs etc. It's what the warning states, for unit testing, use SimulationTestBed test_bed vs UpdateContext

EDIT: Note that if this is still unclear to you, it may be better to leave this to somebody else with more experience with rs as its important that the unit tests that these cover still work (and test) correctly after the refactor.

tracernz commented 5 months ago

@tracernz can you tell me what I need to do in it?

Not sure, that's why I didn't do it. ;)

tracernz commented 5 months ago

Do note that this is a good first issue for somebody already familiar with rust; not for a novice rust programmer.