gstreamer: Fix serde serialization tests

ron serialization is now writing `1.0` instead of just `1`.
This commit is contained in:
Sebastian Dröge 2022-06-24 10:20:44 +03:00
parent 4cefe838f1
commit 62a2ad8a1e
5 changed files with 12 additions and 12 deletions

View file

@ -182,7 +182,7 @@ mod tests {
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, 42.123_456f64).unwrap(); let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, 42.123_456f64).unwrap();
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone()); let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
assert_eq!( assert_eq!(
Ok("YMDhmsTz(2018, 5, 28, 16, 6, 42.123456, 2)".to_owned()), Ok("YMDhmsTz(2018, 5, 28, 16, 6, 42.123456, 2.0)".to_owned()),
res, res,
); );
@ -194,7 +194,7 @@ mod tests {
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, None).unwrap(); let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, None).unwrap();
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone()); let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
assert_eq!(Ok("YMDhmTz(2018, 5, 28, 16, 6, 2)".to_owned()), res,); assert_eq!(Ok("YMDhmTz(2018, 5, 28, 16, 6, 2.0)".to_owned()), res,);
let datetime = DateTime::from_ymd(2018, 5, 28).unwrap(); let datetime = DateTime::from_ymd(2018, 5, 28).unwrap();
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone()); let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());

View file

@ -158,7 +158,7 @@ mod tests {
" flags: (", " flags: (",
" bits: 9,", " bits: 9,",
" ),", " ),",
" rate: 1,", " rate: 1.0,",
" applied_rate: 0.9,", " applied_rate: 0.9,",
" format: Time,", " format: Time,",
" base: 123,", " base: 123,",
@ -213,8 +213,8 @@ mod tests {
" flags: (", " flags: (",
" bits: 0,", " bits: 0,",
" ),", " ),",
" rate: 1,", " rate: 1.0,",
" applied_rate: 1,", " applied_rate: 1.0,",
" format: Time,", " format: Time,",
" base: 0,", " base: 0,",
" offset: 0,", " offset: 0,",

View file

@ -141,7 +141,7 @@ mod tests {
" flags: (", " flags: (",
" bits: 9,", " bits: 9,",
" ),", " ),",
" rate: 1,", " rate: 1.0,",
" applied_rate: 0.9,", " applied_rate: 0.9,",
" format: Time,", " format: Time,",
" base: 123,", " base: 123,",

View file

@ -199,7 +199,7 @@ mod tests {
r#" ("f3", "i32", 123),"#, r#" ("f3", "i32", 123),"#,
r#" ("fraction", "Fraction", (1, 2)),"#, r#" ("fraction", "Fraction", (1, 2)),"#,
r#" ("date", "Date", Some(YMD(2019, 8, 19))),"#, r#" ("date", "Date", Some(YMD(2019, 8, 19))),"#,
r#" ("date_time", "DateTime", Some(YMDhmsTz(2019, 8, 19, 13, 34, 42, 2))),"#, r#" ("date_time", "DateTime", Some(YMDhmsTz(2019, 8, 19, 13, 34, 42.0, 2.0))),"#,
r#" ("array", "Array", ["#, r#" ("array", "Array", ["#,
r#" ("i32", 1),"#, r#" ("i32", 1),"#,
r#" ("i32", 2),"#, r#" ("i32", 2),"#,

View file

@ -371,7 +371,7 @@ mod tests {
r#" 96000,"#, r#" 96000,"#,
r#" ]),"#, r#" ]),"#,
r#" ("replaygain-track-gain", ["#, r#" ("replaygain-track-gain", ["#,
r#" 1,"#, r#" 1.0,"#,
r#" ]),"#, r#" ]),"#,
r#" ("date", ["#, r#" ("date", ["#,
r#" YMD(2018, 5, 28),"#, r#" YMD(2018, 5, 28),"#,
@ -398,8 +398,8 @@ mod tests {
r#" flags: ("#, r#" flags: ("#,
r#" bits: 0,"#, r#" bits: 0,"#,
r#" ),"#, r#" ),"#,
r#" rate: 1,"#, r#" rate: 1.0,"#,
r#" applied_rate: 1,"#, r#" applied_rate: 1.0,"#,
r#" format: Time,"#, r#" format: Time,"#,
r#" base: 0,"#, r#" base: 0,"#,
r#" offset: 0,"#, r#" offset: 0,"#,
@ -434,7 +434,7 @@ mod tests {
]), ]),
("duration", [120000000000]), ("duration", [120000000000]),
("bitrate", [96000]), ("bitrate", [96000]),
("replaygain-track-gain", [1]), ("replaygain-track-gain", [1.0]),
("date", [ ("date", [
YMD(2018, 5, 28), YMD(2018, 5, 28),
]), ]),
@ -497,7 +497,7 @@ mod tests {
["title", ["a title", "another title"]], ["title", ["a title", "another title"]],
["duration", [120000000000]], ["duration", [120000000000]],
["bitrate", [96000]], ["bitrate", [96000]],
["replaygain-track-gain", [1.0]], ["replaygain-track-gain", [1]],
["date",[{"YMD":[2018,5,28]}]], ["date",[{"YMD":[2018,5,28]}]],
["datetime",[{"YMD":[2018,5,28]}]], ["datetime",[{"YMD":[2018,5,28]}]],
["image",[{"buffer":{"pts":null,"dts":null,"duration":null,"offset":0,"offset_end":0,"flags":{"bits":0},"buffer":[1,2,3,4]},"buffer_list":null,"caps":null,"segment":null,"info":null}]] ["image",[{"buffer":{"pts":null,"dts":null,"duration":null,"offset":0,"offset_end":0,"flags":{"bits":0},"buffer":[1,2,3,4]},"buffer_list":null,"caps":null,"segment":null,"info":null}]]