test: proptest suite for protocol and COBS framing
Ten properties covering: RadioConfig roundtrip and validate/resolve determinism; no-panic on arbitrary bytes for both Command::from_bytes and RadioConfig::from_bytes; bounded-capacity for Transmit payloads (guards the heapless::Vec size); Command roundtrip via a test-only encoder (the library only decodes commands); COBS reversibility; and two streaming CobsDecoder properties (no-panic on random byte streams with random chunk boundaries, and a full encode→feed→decode roundtrip). Adds Clone to Command and Response — benign public-API expansion that unblocks proptest's Just strategy.
This commit is contained in:
2 files changed
+336
-2
No files matched your search
+2
-2
@@ -156,7 +156,7 @@ impl RadioConfig {
|
||||
|
||||
/// Host → firmware commands.
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Command {
|
||||
Ping,
|
||||
GetConfig,
|
||||
@@ -220,7 +220,7 @@ impl Command {
|
||||
|
||||
/// Firmware → host responses.
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Response {
|
||||
Pong,
|
||||
Config(RadioConfig),
|
||||
|
||||
Reference in new issue
Block a user