diff --git a/CHANGELOG.md b/CHANGELOG.md index 71c54c6..c82d6db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Check address in I2C transaction start/end operations. (#121) + ### Changed diff --git a/src/eh1/i2c.rs b/src/eh1/i2c.rs index de37f14..91b6045 100644 --- a/src/eh1/i2c.rs +++ b/src/eh1/i2c.rs @@ -264,6 +264,10 @@ impl I2c for Mock { Mode::TransactionStart, "i2c::transaction_start unexpected mode" ); + assert_eq!( + w.expected_addr, address, + "i2c::transaction_start address mismatch" + ); for op in operations { match op { @@ -282,6 +286,10 @@ impl I2c for Mock { Mode::TransactionEnd, "i2c::transaction_end unexpected mode" ); + assert_eq!( + w.expected_addr, address, + "i2c::transaction_end address mismatch" + ); Ok(()) }