Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Dec 12, 2023
1 parent eff4c3d commit f864600
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions bleps/tests/test_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,32 @@ fn init_works() {
let connector = connector();
let mut ble = Ble::new(&connector);

connector.provide_data_to_read(&[0x04, 0x0e, 0x04, 0x05, 0x03, 0x0c, 0x00]);
connector.provide_data_to_read(&[
0x04, 0x0e, 0x04, 0x05, 0x03, 0x0c, 0x00, 0x04, 0x0e, 0x04, 0x05, 0x01, 0x0c, 0x00,
]);

let res = ble.init();

assert_matches!(res, Ok(()));

assert_eq!(connector.get_write_idx(), 4);
assert_eq!(connector.get_write_idx(), 16);
assert_eq!(connector.get_to_write_at(0), 0x01);
assert_eq!(connector.get_to_write_at(1), 0x03);
assert_eq!(connector.get_to_write_at(2), 0x0c);
assert_eq!(connector.get_to_write_at(3), 0x00);

assert_eq!(connector.get_to_write_at(4), 0x01);
assert_eq!(connector.get_to_write_at(5), 0x01);
assert_eq!(connector.get_to_write_at(6), 0x0c);
assert_eq!(connector.get_to_write_at(7), 0x08);
assert_eq!(connector.get_to_write_at(8), 0xff);
assert_eq!(connector.get_to_write_at(9), 0xff);
assert_eq!(connector.get_to_write_at(10), 0xff);
assert_eq!(connector.get_to_write_at(11), 0xff);
assert_eq!(connector.get_to_write_at(12), 0xff);
assert_eq!(connector.get_to_write_at(13), 0xff);
assert_eq!(connector.get_to_write_at(14), 0xff);
assert_eq!(connector.get_to_write_at(15), 0xff);
}

#[test]
Expand Down

0 comments on commit f864600

Please sign in to comment.