Skip to content

Commit

Permalink
more cm::SampleBuf api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Nov 1, 2024
1 parent 9aa1f1a commit a9e30a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cidre/src/cm/sample_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,5 +1050,18 @@ mod tests {
);

assert!(sample_buf.is_key_frame());

let err = sample_buf
.audio_stream_packet_descs()
.expect_err("It is video format");
assert_eq!(err, cm::sample_buf_err::INVALID_MEDIA_TYPE_FOR_OPERATION);

// check with match:
match sample_buf.audio_stream_packet_descs() {
Err(cm::sample_buf_err::INVALID_MEDIA_TYPE_FOR_OPERATION) => {}
_ => {
panic!("should be error")
}
}
}
}

0 comments on commit a9e30a9

Please sign in to comment.