mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
gstreamer: Add a test for various combinations of element_error!
string formatting
This commit is contained in:
parent
6f06a26327
commit
60ad9b5038
1 changed files with 20 additions and 0 deletions
|
@ -1406,4 +1406,24 @@ mod tests {
|
|||
|
||||
assert_eq!(receiver.recv(), Ok(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_element_error() {
|
||||
crate::init().unwrap();
|
||||
|
||||
let identity = crate::ElementFactory::make("identity").build().unwrap();
|
||||
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ("msg"), ["debug"]);
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ["debug"]);
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ("msg"));
|
||||
|
||||
// We define a new variable for each call so there would be a compiler warning if the
|
||||
// string formatting did not actually use it.
|
||||
let x = 123i32;
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ("msg {x}"), ["debug"]);
|
||||
let x = 123i32;
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ["debug {x}"]);
|
||||
let x = 123i32;
|
||||
crate::element_error!(identity, crate::CoreError::Failed, ("msg {}", x));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue