From b5d8b4472597814b1bf4df205fac8b0e9245cdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 28 Jul 2017 16:56:27 +0100 Subject: [PATCH] Renable caps value-array unit test --- gstreamer/src/caps.rs | 13 ++++++------- gstreamer/src/value.rs | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 7ce4ccff1..130bdd721 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -359,6 +359,7 @@ unsafe impl Send for CapsRef {} mod tests { use super::*; use Fraction; + use Array; #[test] fn test_simple() { @@ -371,15 +372,13 @@ mod tests { ("bool", &true), ("string", &"bla"), ("fraction", &Fraction::new(1, 2)), - //("array", vec![1.into(), 2.into()].into()), + ("array", &Array::new(&[&1, &2])), ], ); assert_eq!( caps.to_string(), - "foo/bar, int=(int)12, bool=(boolean)true, string=(string)bla, fraction=(fraction)1/2" - ); //, \ - // array=(int)< 1, 2 >" - //); + "foo/bar, int=(int)12, bool=(boolean)true, string=(string)bla, fraction=(fraction)1/2, array=(int)< 1, 2 >" + ); let s = caps.get_structure(0).unwrap(); assert_eq!( @@ -390,8 +389,8 @@ mod tests { ("int", &12), ("bool", &true), ("string", &"bla"), - ("fraction", &Fraction::new(1, 2)) - //("array", vec![1.into(), 2.into()].into()), + ("fraction", &Fraction::new(1, 2)), + ("array", &Array::new(&[&1, &2])), ], ).as_ref() ); diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index ef0d5d6ad..5538105d6 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -457,7 +457,7 @@ impl<'a> FromValueOptional<'a> for Array<'a> { impl<'a> SetValue for Array<'a> { unsafe fn set_value(v: &mut Value, a: &Self) { for value in a.as_slice() { - ffi::gst_value_array_append_and_take_value(v.to_glib_none_mut().0, value.to_glib_full() as *mut _); + ffi::gst_value_array_append_value(v.to_glib_none_mut().0, value.to_glib_none().0); } } } @@ -517,7 +517,7 @@ impl<'a> FromValueOptional<'a> for List<'a> { impl<'a> SetValue for List<'a> { unsafe fn set_value(v: &mut Value, a: &Self) { for value in a.as_slice() { - ffi::gst_value_list_append_and_take_value(v.to_glib_none_mut().0, value.to_glib_full() as *mut _); + ffi::gst_value_list_append_value(v.to_glib_none_mut().0, value.to_glib_none().0); } } }