From 2e0f52de2ca65d2c158a736e7da70c5727bd2cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 9 Sep 2024 14:35:40 +0300 Subject: [PATCH] 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: --- utils/uriplaylistbin/tests/uriplaylistbin.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/uriplaylistbin/tests/uriplaylistbin.rs b/utils/uriplaylistbin/tests/uriplaylistbin.rs index 49d136eb..739cfe96 100644 --- a/utils/uriplaylistbin/tests/uriplaylistbin.rs +++ b/utils/uriplaylistbin/tests/uriplaylistbin.rs @@ -242,10 +242,12 @@ fn test( (events, current_iteration, current_uri_index) } +#[track_caller] fn assert_eos(msg: gst::Message) { assert!(matches!(msg.view(), MessageView::Eos(_))); } +#[track_caller] fn assert_error(msg: gst::Message, failing: TestMedia) { match msg.view() { 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 { match msg.view() { 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 { match msg.view() { MessageView::StreamsSelected(ss) => {