Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Jun 30, 2024
1 parent eb600c3 commit 7aead59
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions tests/adapter_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,31 @@ static BULK_ASYNC_TIMEOUT_MS: u64 = 5000;
fn get_test_frames(amount: usize) -> Vec<Frame> {
let mut frames = vec![];

// Add some frames with special IDs
frames.push(Frame::new(0, 0x1234.into(), &[0xAA]).unwrap());
frames.push(Frame::new(0, Identifier::Extended(0x123), &[0xAA]).unwrap());

// Add some edges cases to test
frames.push(
Frame::new(
0,
0x1234.into(),
&[0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA],
)
.unwrap(),
);
frames.push(
Frame::new(
0,
Identifier::Extended(0x123),
&[0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA],
)
.unwrap(),
);
frames.push(Frame::new(0, 0x0.into(), &[]).unwrap());

// Add bulk
for i in 0..amount {
frames.push(Frame::new(0, 0x123.into(), &i.to_be_bytes()).unwrap());
}

frames

}

/// Sends a large number of frames to a "blocking" adapter, and then reads back all sent messages.
Expand Down

0 comments on commit 7aead59

Please sign in to comment.