Skip to content

Commit

Permalink
refactor: format frame funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav2612000 committed May 18, 2024
1 parent 183cb65 commit 4e99db1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scap/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,25 @@ mod tests {
#[test]
fn test_remove_alpha_channel() {
assert_eq!(remove_alpha_channel(vec![1, 2, 3, 0]), vec![1, 2, 3]);
assert_eq!(remove_alpha_channel(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![1, 2, 3, 5, 6, 7]);
assert_eq!(
remove_alpha_channel(vec![1, 2, 3, 4, 5, 6, 7, 8]),
vec![1, 2, 3, 5, 6, 7]
);
}

#[test]
fn test_convert_bgra_to_rgb() {
assert_eq!(convert_bgra_to_rgb(vec![1, 2, 3, 0]), vec![3, 2, 1]);
assert_eq!(convert_bgra_to_rgb(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![3, 2, 1, 7, 6, 5]);
assert_eq!(
convert_bgra_to_rgb(vec![1, 2, 3, 4, 5, 6, 7, 8]),
vec![3, 2, 1, 7, 6, 5]
);
}

macro_rules! rgba {
($n:expr) => {
&mut vec![$n, $n, $n, $n]
}
};
}

#[test]
Expand Down

0 comments on commit 4e99db1

Please sign in to comment.