makers-for-life / makair

🫁 The world's first open-source ventilator tested on human patients. Mass-producible at a low cost (~2000€).
Other
818 stars 78 forks source link

[Telemetry] proptest for parsers.rs #203

Closed ronanM closed 4 years ago

ronanM commented 4 years ago

I have added proptest for parsing BootMessage (but I don't understood the device_id logic).

If you found that useful, i could continue with other messages.

BlackYoup commented 4 years ago

Hi!

I didn't know proptest, this seems nice. From what I understand, it will test multiple scenarios based on the format you give and will change parts of it each time?

but I don't understood the device_id logic

I may be mistaken but each makair device will have its own ID which is given in the device_id field. You can find more information in this issue: https://github.com/makers-for-life/makair/issues/120

I'll let @dsferruzza rule on this one but it seems good for me (maybe just remove the commented // println!("{:?}",&msg);)

dsferruzza commented 4 years ago

@ronanM I just noticed that clippy rises several warnings; could you have a look?

I think you just need to have clippy installed and run cargo clippy --all-targets --all-features.

ronanM commented 4 years ago

I think that all TelemetryMessage messages are tested.

dsferruzza commented 4 years ago

Thanks @ronanM!