Commit b5d8b447 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Renable caps value-array unit test

parent 3bc06870
......@@ -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()
);
......
......@@ -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);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment