Skip to content

Commit

Permalink
Add tests for data_buffer_pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
lemolatoon committed Jul 19, 2023
1 parent 96bc167 commit d869919
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/ring/trb/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,3 +527,23 @@ pub enum TransferType {
/// In Data Stage.
In = 3,
}

#[cfg(tests)]
mod tests {
use super::*;

#[test]
fn data_buffer_pointer_test() {
let mut normal = Normal::new();
let pointer = 0x12345678_9abcdef0;
normal.set_data_buffer_pointer(pointer);
let pointer_read = normal.data_buffer_pointer();
assert_eq!(pointer, pointer_read);

let mut isoch = Isoch::new();
let pointer = 0xabcd1234_567890ef;
isoch.set_data_buffer_pointer(pointer);
let pointer_read = isoch.data_buffer_pointer();
assert_eq!(pointer, pointer_read);
}
}

0 comments on commit d869919

Please sign in to comment.