uriplaylistbin: Track actual caller in test assertion functions

Makes it easier to figure out from where it is actually called when the
assertion is failing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1769>
This commit is contained in:
Sebastian Dröge 2024-09-09 14:35:40 +03:00
parent 7a959b9e9d
commit 2e0f52de2c

View file

@ -242,10 +242,12 @@ fn test(
(events, current_iteration, current_uri_index) (events, current_iteration, current_uri_index)
} }
#[track_caller]
fn assert_eos(msg: gst::Message) { fn assert_eos(msg: gst::Message) {
assert!(matches!(msg.view(), MessageView::Eos(_))); assert!(matches!(msg.view(), MessageView::Eos(_)));
} }
#[track_caller]
fn assert_error(msg: gst::Message, failing: TestMedia) { fn assert_error(msg: gst::Message, failing: TestMedia) {
match msg.view() { match msg.view() {
MessageView::Error(err) => { MessageView::Error(err) => {
@ -258,6 +260,7 @@ fn assert_error(msg: gst::Message, failing: TestMedia) {
} }
} }
#[track_caller]
fn assert_stream_collection(msg: gst::Message, n_streams: usize) -> gst::Object { fn assert_stream_collection(msg: gst::Message, n_streams: usize) -> gst::Object {
match msg.view() { match msg.view() {
MessageView::StreamCollection(sc) => { MessageView::StreamCollection(sc) => {
@ -271,6 +274,7 @@ fn assert_stream_collection(msg: gst::Message, n_streams: usize) -> gst::Object
} }
} }
#[track_caller]
fn assert_stream_selected(msg: gst::Message, n_streams: usize) -> gst::Object { fn assert_stream_selected(msg: gst::Message, n_streams: usize) -> gst::Object {
match msg.view() { match msg.view() {
MessageView::StreamsSelected(ss) => { MessageView::StreamsSelected(ss) => {