Skip to content

Commit

Permalink
Always include glib and gobject girs in mode:object
Browse files Browse the repository at this point in the history
  • Loading branch information
EPashkin committed May 19, 2018
1 parent 1108306 commit 0c59906
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/read_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ fn load_bitfield() {
#[test]
fn load_class() {
let library = read_library("class.gir").unwrap();
let typ_object = library.find_type(0, "GObject.Object").unwrap();
let typ_app_info = library.find_type(0, "Tst.AppInfo").unwrap();
let typ_variant = library.find_type(0, "GLib.Variant").unwrap();
let c: &library::Class = get_type(&library, "AppLaunchContext");
assert_eq!(c.c_type, "GAppLaunchContext");
assert_eq!(c.type_struct, Some("AppLaunchContextClass".into()));
assert_eq!(c.glib_get_type, "g_app_launch_context_get_type");
assert_eq!(c.parent, Some(typ_object));
assert_eq!(c.parent.unwrap().full_name(&library), "GObject.Object");
assert_eq!(c.version, None);
let f = &c.functions[0];
assert_eq!(f.name, "new");
Expand All @@ -138,7 +136,7 @@ fn load_class() {
let f = &c.fields[0];
assert_eq!(f.name, "parent_instance");
assert_eq!(f.c_type, Some("GObject".into()));
assert_eq!(f.typ, typ_object);
assert_eq!(f.typ.full_name(&library), "GObject.Object");
assert_eq!(f.private, false);
let s = &c.signals[0];
assert_eq!(s.name, "launched");
Expand All @@ -152,7 +150,7 @@ fn load_class() {
let p = &s.parameters[1];
assert_eq!(p.name, "platform_data");
assert_eq!(p.c_type, library::EMPTY_CTYPE);
assert_eq!(p.typ, typ_variant);
assert_eq!(p.typ.full_name(&library), "GLib.Variant");
assert_eq!(p.transfer, library::Transfer::None);
let p = &s.ret;
assert_eq!(p.name, "");
Expand Down
2 changes: 2 additions & 0 deletions tests/test_util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ pub fn read_parameterized<P: AsRef<Path>>(
"object" => {
let begin = r##"<?xml version="1.0"?>
<repository xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0" version="1.2">
<include name="GLib" version="2.0"/>
<include name="GObject" version="2.0"/>
<package name="tst-1.0"/>
<namespace name="Tst" version="1.0" c:identifier-prefixes="T" c:symbol-prefixes="t,tst">
"##
Expand Down

0 comments on commit 0c59906

Please sign in to comment.