Re-enable Caps tests

This commit is contained in:
Sebastian Dröge 2017-07-12 10:32:39 +03:00
parent 64f8b8c015
commit b44c815696
2 changed files with 17 additions and 19 deletions

View file

@ -12,6 +12,7 @@ use structure::*;
use glib; use glib;
use ffi; use ffi;
use glib::ToValue;
use glib::translate::{from_glib, from_glib_none, from_glib_full, ToGlibPtr}; use glib::translate::{from_glib, from_glib_none, from_glib_full, ToGlibPtr};
#[repr(C)] #[repr(C)]
@ -221,45 +222,44 @@ impl ToOwned for CapsRef {
unsafe impl Sync for CapsRef {} unsafe impl Sync for CapsRef {}
unsafe impl Send for CapsRef {} unsafe impl Send for CapsRef {}
/*
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
#[test] #[test]
fn test_simple() { fn test_simple() {
gst::init(); ::init().unwrap();
let caps = Caps::new_simple( let caps = Caps::new_simple(
"foo/bar", "foo/bar",
&[ &[
("int", 12.into()), ("int", &12.to_value()),
("bool", true.into()), ("bool", &true.to_value()),
("string", "bla".into()), ("string", &"bla".to_value()),
("fraction", (1, 2).into()), //("fraction", (1, 2).into()),
("array", vec![1.into(), 2.into()].into()), //("array", vec![1.into(), 2.into()].into()),
], ],
); );
assert_eq!( assert_eq!(
caps.to_string(), caps.to_string(),
"foo/bar, int=(int)12, bool=(boolean)true, string=(string)bla, \ "foo/bar, int=(int)12, bool=(boolean)true, string=(string)bla"
fraction=(fraction)1/2, array=(int)< 1, 2 >" ); //, \
); // fraction=(fraction)1/2, array=(int)< 1, 2 >"
//);
let s = caps.get_structure(0).unwrap(); let s = caps.get_structure(0).unwrap();
assert_eq!( assert_eq!(
s, s,
OwnedStructure::new( Structure::new(
"foo/bar", "foo/bar",
&[ &[
("int", 12.into()), ("int", &12.to_value()),
("bool", true.into()), ("bool", &true.to_value()),
("string", "bla".into()), ("string", &"bla".to_value()),
("fraction", (1, 2).into()), //("fraction", (1, 2).into()),
("array", vec![1.into(), 2.into()].into()), //("array", vec![1.into(), 2.into()].into()),
], ],
).as_ref() ).as_ref()
); );
} }
} }
*/

View file

@ -8,10 +8,8 @@
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use std::ffi::{CStr, CString};
use std::marker::PhantomData; use std::marker::PhantomData;
use glib;
use ffi; use ffi;
use glib::StaticType; use glib::StaticType;
use glib::value::{Value, TypedValue, FromValueOptional, SetValue, ToValue}; use glib::value::{Value, TypedValue, FromValueOptional, SetValue, ToValue};