-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Sample for byte arrays (#35)
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#[test] | ||
fn test_byte_array() { | ||
let buf: crate::buf::Interleaved<[u8; 2]> = | ||
crate::interleaved![[[1, 2], [3, 4]], [[5, 6], [7, 8]]]; | ||
|
||
assert_eq!(buf.channels(), 2); | ||
assert_eq!(buf.sample(0, 0).unwrap(), [1, 2]); | ||
assert_eq!(buf.sample(0, 1).unwrap(), [3, 4]); | ||
assert_eq!(buf.sample(1, 0).unwrap(), [5, 6]); | ||
assert_eq!(buf.sample(1, 1).unwrap(), [7, 8]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod byte_arrays; | ||
mod copy_channel; | ||
mod dynamic; | ||
mod interleaved; | ||
|