gir_ffi 0.6.7 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/{History.txt → Changelog.md} +93 -61
  3. data/{DESIGN.rdoc → DESIGN.md} +7 -7
  4. data/README.md +5 -7
  5. data/TODO.md +90 -0
  6. data/lib/ffi-glib.rb +0 -1
  7. data/lib/ffi-glib/array.rb +13 -29
  8. data/lib/ffi-glib/array_methods.rb +13 -0
  9. data/lib/ffi-glib/container_class_methods.rb +6 -1
  10. data/lib/ffi-glib/hash_table.rb +3 -2
  11. data/lib/ffi-glib/list.rb +3 -17
  12. data/lib/ffi-glib/list_methods.rb +22 -3
  13. data/lib/ffi-glib/ptr_array.rb +19 -19
  14. data/lib/ffi-glib/s_list.rb +3 -17
  15. data/lib/ffi-gobject.rb +10 -17
  16. data/lib/ffi-gobject/object.rb +19 -9
  17. data/lib/ffi-gobject/object_class.rb +14 -0
  18. data/lib/ffi-gobject/ruby_closure.rb +4 -5
  19. data/lib/ffi-gobject/value.rb +7 -5
  20. data/lib/ffi-gobject_introspection/i_vfunc_info.rb +1 -1
  21. data/lib/gir_ffi-base.rb +0 -2
  22. data/lib/gir_ffi-base/gobject.rb +1 -0
  23. data/lib/gir_ffi-base/gobject/lib.rb +1 -1
  24. data/lib/gir_ffi.rb +2 -0
  25. data/lib/gir_ffi/arg_helper.rb +18 -8
  26. data/lib/gir_ffi/builders/argument_builder.rb +62 -55
  27. data/lib/gir_ffi/builders/base_argument_builder.rb +52 -106
  28. data/lib/gir_ffi/builders/base_type_builder.rb +3 -3
  29. data/lib/gir_ffi/builders/c_to_ruby_convertor.rb +34 -0
  30. data/lib/gir_ffi/builders/callback_argument_builder.rb +73 -0
  31. data/lib/gir_ffi/builders/callback_builder.rb +19 -9
  32. data/lib/gir_ffi/builders/callback_return_value_builder.rb +54 -0
  33. data/lib/gir_ffi/builders/closure_convertor.rb +9 -0
  34. data/lib/gir_ffi/builders/closure_to_pointer_convertor.rb +9 -0
  35. data/lib/gir_ffi/builders/constructor_result_convertor.rb +9 -0
  36. data/lib/gir_ffi/builders/enum_builder.rb +16 -16
  37. data/lib/gir_ffi/builders/field_builder.rb +36 -15
  38. data/lib/gir_ffi/builders/function_builder.rb +32 -27
  39. data/lib/gir_ffi/builders/interface_builder.rb +14 -4
  40. data/lib/gir_ffi/builders/mapping_method_builder.rb +95 -43
  41. data/lib/gir_ffi/builders/module_builder.rb +22 -35
  42. data/lib/gir_ffi/builders/null_convertor.rb +9 -0
  43. data/lib/gir_ffi/builders/object_builder.rb +11 -14
  44. data/lib/gir_ffi/builders/property_builder.rb +107 -9
  45. data/lib/gir_ffi/builders/registered_type_builder.rb +2 -2
  46. data/lib/gir_ffi/builders/return_value_builder.rb +42 -33
  47. data/lib/gir_ffi/builders/ruby_to_c_convertor.rb +15 -0
  48. data/lib/gir_ffi/builders/signal_builder.rb +18 -58
  49. data/lib/gir_ffi/builders/struct_builder.rb +1 -2
  50. data/lib/gir_ffi/builders/type_builder.rb +1 -0
  51. data/lib/gir_ffi/builders/unintrospectable_builder.rb +4 -4
  52. data/lib/gir_ffi/builders/user_defined_builder.rb +151 -26
  53. data/lib/gir_ffi/builders/vfunc_builder.rb +57 -0
  54. data/lib/gir_ffi/builders/with_layout.rb +10 -8
  55. data/lib/gir_ffi/builders/with_methods.rb +1 -1
  56. data/lib/gir_ffi/callback_base.rb +42 -8
  57. data/lib/gir_ffi/class_base.rb +1 -2
  58. data/lib/gir_ffi/enum_base.rb +26 -4
  59. data/lib/gir_ffi/error_argument_info.rb +21 -0
  60. data/lib/gir_ffi/{setter_argument_info.rb → field_argument_info.rb} +2 -1
  61. data/lib/gir_ffi/g_type.rb +25 -0
  62. data/lib/gir_ffi/in_out_pointer.rb +3 -14
  63. data/lib/gir_ffi/in_pointer.rb +20 -21
  64. data/lib/gir_ffi/info_ext.rb +2 -0
  65. data/lib/gir_ffi/info_ext/i_callable_info.rb +0 -9
  66. data/lib/gir_ffi/info_ext/i_callback_info.rb +17 -0
  67. data/lib/gir_ffi/info_ext/i_function_info.rb +4 -0
  68. data/lib/gir_ffi/info_ext/i_property_info.rb +4 -0
  69. data/lib/gir_ffi/info_ext/i_registered_type_info.rb +1 -0
  70. data/lib/gir_ffi/info_ext/i_signal_info.rb +14 -16
  71. data/lib/gir_ffi/info_ext/i_type_info.rb +72 -34
  72. data/lib/gir_ffi/info_ext/i_vfunc_info.rb +12 -0
  73. data/lib/gir_ffi/info_ext/safe_constant_name.rb +3 -2
  74. data/lib/gir_ffi/interface_base.rb +8 -3
  75. data/lib/gir_ffi/module_base.rb +3 -5
  76. data/lib/gir_ffi/object_base.rb +8 -0
  77. data/lib/gir_ffi/receiver_argument_info.rb +21 -0
  78. data/lib/gir_ffi/receiver_type_info.rb +27 -0
  79. data/lib/gir_ffi/return_value_info.rb +23 -0
  80. data/lib/gir_ffi/signal_base.rb +1 -1
  81. data/lib/{ffi-glib → gir_ffi}/sized_array.rb +10 -6
  82. data/lib/gir_ffi/struct_base.rb +10 -9
  83. data/lib/gir_ffi/type_base.rb +1 -0
  84. data/lib/gir_ffi/type_map.rb +3 -0
  85. data/lib/gir_ffi/unintrospectable_type_info.rb +4 -1
  86. data/lib/gir_ffi/union_base.rb +4 -21
  87. data/lib/gir_ffi/user_data_argument_info.rb +21 -0
  88. data/lib/gir_ffi/user_data_type_info.rb +17 -0
  89. data/lib/gir_ffi/user_defined_type_info.rb +18 -4
  90. data/lib/gir_ffi/version.rb +1 -1
  91. data/lib/gir_ffi/vfunc_base.rb +8 -0
  92. data/lib/gir_ffi/vfunc_implementation.rb +11 -0
  93. data/lib/gir_ffi/zero_terminated.rb +18 -24
  94. data/test/base_test_helper.rb +2 -3
  95. data/test/ffi-glib/array_test.rb +3 -3
  96. data/test/ffi-glib/ruby_closure_test.rb +3 -3
  97. data/test/ffi-gobject/value_test.rb +15 -1
  98. data/test/ffi-gobject_test.rb +2 -1
  99. data/test/gir_ffi/arg_helper_test.rb +21 -2
  100. data/test/gir_ffi/builders/argument_builder_test.rb +213 -287
  101. data/test/gir_ffi/builders/base_argument_builder_test.rb +1 -1
  102. data/test/gir_ffi/builders/callback_builder_test.rb +26 -8
  103. data/test/gir_ffi/builders/field_builder_test.rb +18 -3
  104. data/test/gir_ffi/builders/function_builder_test.rb +30 -12
  105. data/test/gir_ffi/builders/interface_builder_test.rb +9 -0
  106. data/test/gir_ffi/builders/module_builder_test.rb +0 -39
  107. data/test/gir_ffi/builders/object_builder_test.rb +27 -27
  108. data/test/gir_ffi/builders/property_builder_test.rb +110 -0
  109. data/test/gir_ffi/builders/return_value_builder_test.rb +168 -200
  110. data/test/gir_ffi/builders/signal_builder_test.rb +58 -14
  111. data/test/gir_ffi/builders/struct_builder_test.rb +2 -41
  112. data/test/gir_ffi/builders/user_defined_builder_test.rb +88 -20
  113. data/test/gir_ffi/builders/vfunc_builder_test.rb +44 -0
  114. data/test/gir_ffi/g_type_test.rb +29 -0
  115. data/test/gir_ffi/in_pointer_test.rb +28 -9
  116. data/test/gir_ffi/info_ext/i_callable_info_test.rb +0 -9
  117. data/test/gir_ffi/info_ext/i_callback_info_test.rb +19 -0
  118. data/test/gir_ffi/info_ext/i_function_info_test.rb +9 -0
  119. data/test/gir_ffi/info_ext/i_signal_info_test.rb +8 -11
  120. data/test/gir_ffi/info_ext/i_type_info_test.rb +140 -16
  121. data/test/gir_ffi/interface_base_test.rb +9 -3
  122. data/test/gir_ffi/object_base_test.rb +1 -2
  123. data/test/{ffi-glib → gir_ffi}/sized_array_test.rb +28 -28
  124. data/test/gir_ffi/type_map_test.rb +1 -1
  125. data/test/gir_ffi/user_defined_type_info_test.rb +36 -4
  126. data/test/gir_ffi_test.rb +5 -5
  127. data/test/gir_ffi_test_helper.rb +4 -0
  128. data/test/integration/generated_gimarshallingtests_test.rb +163 -59
  129. data/test/integration/generated_gobject_test.rb +21 -8
  130. data/test/integration/generated_pango_test.rb +2 -2
  131. data/test/integration/generated_regress_test.rb +361 -101
  132. data/test/lib/autogen.sh +5 -1
  133. metadata +51 -35
  134. data/TODO.rdoc +0 -63
  135. data/lib/gir_ffi-base/gir_ffi/library.rb +0 -17
  136. data/lib/gir_ffi-base/gir_ffi/struct.rb +0 -27
@@ -0,0 +1,23 @@
1
+ module GirFFI
2
+ # Represents a return value with the same interface as IArgumentInfo
3
+ class ReturnValueInfo
4
+ attr_reader :argument_type
5
+
6
+ def initialize type, skip = false
7
+ @argument_type = type
8
+ @skip = skip
9
+ end
10
+
11
+ def skip?
12
+ @skip
13
+ end
14
+
15
+ def direction
16
+ :return
17
+ end
18
+
19
+ def name
20
+ nil
21
+ end
22
+ end
23
+ end
@@ -11,8 +11,8 @@ module GirFFI
11
11
  end
12
12
 
13
13
  def wrap_in_callback_args_mapper prc
14
+ return if !prc
14
15
  return prc if FFI::Function === prc
15
- return nil if prc.nil?
16
16
  return Proc.new do |*args|
17
17
  call_with_argument_mapping(prc, *args)
18
18
  end
@@ -1,5 +1,4 @@
1
- # FIXME: SizedArray does not really belong in GLib, does it?
2
- module GLib
1
+ module GirFFI
3
2
  # Class representing an array with a determined size
4
3
  class SizedArray
5
4
  include Enumerable
@@ -34,6 +33,10 @@ module GLib
34
33
  size * element_size
35
34
  end
36
35
 
36
+ def self.get_value_from_pointer pointer
37
+ pointer
38
+ end
39
+
37
40
  def self.copy_value_to_pointer value, pointer
38
41
  size = value.size_in_bytes
39
42
  pointer.put_bytes(0, value.to_ptr.read_bytes(size), 0, size)
@@ -70,14 +73,15 @@ module GLib
70
73
  private
71
74
 
72
75
  def from_sized_array size, sized_array
73
- check_size(size, sized_array.size)
76
+ check_size size, sized_array.size
74
77
  sized_array
75
78
  end
76
79
 
77
- def from_enumerable element_type, size, arr
78
- check_size(size, arr.size)
80
+ def from_enumerable element_type, expected_size, arr
81
+ size = arr.size
82
+ check_size expected_size, size
79
83
  ptr = GirFFI::InPointer.from_array element_type, arr
80
- self.wrap element_type, arr.size, ptr
84
+ self.wrap element_type, size, ptr
81
85
  end
82
86
 
83
87
  def check_size(expected_size, size)
@@ -1,24 +1,25 @@
1
+ require 'gir_ffi/class_base'
2
+
1
3
  module GirFFI
4
+ # Base class for generated classes representing GLib structs.
2
5
  class StructBase < ClassBase
3
6
  extend FFI::DataConverter
4
- def self.native_type
5
- self::Struct.native_type
6
- end
7
7
 
8
- def self.to_native value, context
9
- self::Struct.new(value.to_ptr)
8
+ def self.native_type
9
+ FFI::Type::Struct.new(self::Struct)
10
10
  end
11
11
 
12
12
  def self.to_ffitype
13
13
  self
14
14
  end
15
15
 
16
- def self.copy_value_to_pointer value, pointer, offset=0
17
- self::Struct.copy_value_to_pointer value, pointer, offset
16
+ def self.get_value_from_pointer pointer
17
+ pointer.to_ptr
18
18
  end
19
19
 
20
- def self.get_value_from_pointer pointer
21
- self::Struct.get_value_from_pointer pointer
20
+ def self.copy_value_to_pointer value, pointer, offset=0
21
+ size = self::Struct.size
22
+ pointer.put_bytes offset, value.to_ptr.read_bytes(size), 0, size
22
23
  end
23
24
  end
24
25
  end
@@ -1,4 +1,5 @@
1
1
  module GirFFI
2
+ # Base module for all generated GLib types.
2
3
  module TypeBase
3
4
  def gir_ffi_builder
4
5
  self.const_get :GIR_FFI_BUILDER
@@ -1,3 +1,5 @@
1
+ require 'gir_ffi/sized_array'
2
+
1
3
  module GirFFI
2
4
  module TypeMap
3
5
  sz = FFI.type_size(:size_t) * 8
@@ -15,6 +17,7 @@ module GirFFI
15
17
  :error => :pointer,
16
18
  :ptr_array => :pointer,
17
19
  :array => :pointer,
20
+ :c => GirFFI::SizedArray,
18
21
  :utf8 => :pointer,
19
22
  :GType => gtype_type,
20
23
  :gboolean => GLib::Boolean,
@@ -21,10 +21,13 @@ module GirFFI
21
21
  end
22
22
 
23
23
  def parent
24
- parent_gtype = @gobject.type_parent(@g_type)
25
24
  @gir.find_by_gtype(parent_gtype) || self.class.new(parent_gtype, @gir, @gobject)
26
25
  end
27
26
 
27
+ def parent_gtype
28
+ @parent_gtype ||= @gobject.type_parent @g_type
29
+ end
30
+
28
31
  def namespace
29
32
  parent.namespace
30
33
  end
@@ -1,24 +1,7 @@
1
- module GirFFI
2
- class UnionBase < ClassBase
3
- extend FFI::DataConverter
4
-
5
- def self.native_type
6
- FFI::Type::Struct.new(self::Struct)
7
- end
8
-
9
- def self.to_ffitype
10
- self
11
- end
1
+ require 'gir_ffi/struct_base'
12
2
 
13
- # FIXME: Duplicate of GirFFI::Struct
14
- def self.get_value_from_pointer pointer
15
- pointer.to_ptr
16
- end
17
-
18
- # FIXME: Duplicate of GirFFI::Struct
19
- def self.copy_value_to_pointer value, pointer, offset=0
20
- size = self::Struct.size
21
- pointer.put_bytes offset, value.to_ptr.read_bytes(size), 0, size
22
- end
3
+ module GirFFI
4
+ # Base class for generated classes representing GLib unions.
5
+ class UnionBase < StructBase
23
6
  end
24
7
  end
@@ -0,0 +1,21 @@
1
+ # Class to represent the info for the user data argument of a signal handler.
2
+ # Implements the necessary parts of IArgumentInfo's interface.
3
+ class GirFFI::UserDataArgumentInfo
4
+ attr_reader :argument_type
5
+
6
+ def initialize type
7
+ @argument_type = type
8
+ end
9
+
10
+ def direction
11
+ :in
12
+ end
13
+
14
+ def skip?
15
+ false
16
+ end
17
+
18
+ def name
19
+ "_user_data"
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ require 'gir_ffi/info_ext/i_type_info'
2
+
3
+ class GirFFI::UserDataTypeInfo
4
+ include GirFFI::InfoExt::ITypeInfo
5
+
6
+ def tag
7
+ :void
8
+ end
9
+
10
+ def pointer?
11
+ true
12
+ end
13
+
14
+ def array_length
15
+ -1
16
+ end
17
+ end
@@ -1,13 +1,17 @@
1
1
  require 'gir_ffi/user_defined_property_info'
2
+ require 'gir_ffi/vfunc_implementation'
2
3
 
3
4
  module GirFFI
4
5
  # Represents a user defined type, conforming, as needed, to the interface of
5
6
  # GObjectIntrospection::IObjectInfo.
6
7
  class UserDefinedTypeInfo
7
- def initialize klass, &block
8
+ attr_reader :properties, :vfunc_implementations
9
+
10
+ def initialize klass
8
11
  @klass = klass
9
12
  @properties = []
10
- self.instance_eval(&block) if block
13
+ @vfunc_implementations = []
14
+ yield self if block_given?
11
15
  end
12
16
 
13
17
  def described_class
@@ -18,8 +22,18 @@ module GirFFI
18
22
  @properties << UserDefinedPropertyInfo.new(property)
19
23
  end
20
24
 
21
- def properties
22
- @properties
25
+ def install_vfunc_implementation name, implementation
26
+ @vfunc_implementations << VFuncImplementation.new(name, implementation)
27
+ end
28
+
29
+ def find_instance_method _method
30
+ nil
31
+ end
32
+
33
+ attr_writer :g_name
34
+
35
+ def g_name
36
+ @g_name ||= @klass.name
23
37
  end
24
38
  end
25
39
  end
@@ -1,3 +1,3 @@
1
1
  module GirFFI
2
- VERSION = "0.6.7"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -0,0 +1,8 @@
1
+ require 'gir_ffi/callback_base'
2
+
3
+ module GirFFI
4
+ # Base class for virtual methods (vfuncs).
5
+ class VFuncBase < CallbackBase
6
+ end
7
+ end
8
+
@@ -0,0 +1,11 @@
1
+ module GirFFI
2
+ # Simple wrapper class to represent the implementation of a VFunc.
3
+ class VFuncImplementation
4
+ attr_reader :name, :implementation
5
+
6
+ def initialize name, implementation
7
+ @name = name
8
+ @implementation = implementation
9
+ end
10
+ end
11
+ end
@@ -27,10 +27,7 @@ module GirFFI
27
27
  offset = 0
28
28
  while val = read_value(offset)
29
29
  offset += FFI.type_size(ffi_type)
30
- if complex_element_type?
31
- val = element_class.wrap val
32
- end
33
- yield val
30
+ yield wrap_value(val)
34
31
  end
35
32
  end
36
33
 
@@ -41,39 +38,36 @@ module GirFFI
41
38
  private
42
39
 
43
40
  def read_value offset
44
- val = @ptr.send("get_#{ffi_type}", offset)
45
- return val unless is_null_value(val)
41
+ val = @ptr.send(getter_method, offset)
42
+ return val unless is_null_value?(val)
46
43
  end
47
44
 
48
- def ffi_type
49
- @ffi_type ||= TypeMap.type_specification_to_ffitype basic_element_type
50
- end
51
-
52
- def complex_element_type?
53
- Array === element_type
45
+ def getter_method
46
+ @getter_method ||= "get_#{ffi_type}"
54
47
  end
55
48
 
56
- def basic_element_type
57
- if complex_element_type?
58
- element_type.first
49
+ def wrap_value(val)
50
+ case element_type
51
+ when Array
52
+ element_type.last.wrap val
53
+ when Class
54
+ element_type.wrap val
59
55
  else
60
- element_type
56
+ val
61
57
  end
62
58
  end
63
59
 
64
- def is_null_value value
65
- if basic_element_type == :pointer
60
+ def ffi_type
61
+ @ffi_type ||= TypeMap.type_specification_to_ffitype element_type
62
+ end
63
+
64
+ def is_null_value? value
65
+ if ffi_type == :pointer
66
66
  value.null?
67
67
  else
68
68
  value == 0
69
69
  end
70
70
  end
71
-
72
- def element_class
73
- if complex_element_type?
74
- element_type.last
75
- end
76
- end
77
71
  end
78
72
  end
79
73
 
@@ -2,11 +2,12 @@ if RUBY_PLATFORM == 'java'
2
2
  require 'rubygems'
3
3
  end
4
4
 
5
- if RUBY_VERSION >= "1.9"
5
+ begin
6
6
  require 'simplecov'
7
7
  SimpleCov.start do
8
8
  add_filter "/test/"
9
9
  end
10
+ rescue LoadError
10
11
  end
11
12
 
12
13
  require 'minitest/autorun'
@@ -37,8 +38,6 @@ end
37
38
  Thread.abort_on_exception = true
38
39
 
39
40
  class Minitest::Test
40
- include RR::Adapters::TestUnit
41
-
42
41
  def assert_defines_singleton_method klass, method, msg = nil
43
42
  method = method.to_sym
44
43
  methods = klass.singleton_methods(false).map { |name| name.to_sym }
@@ -70,18 +70,18 @@ describe GLib::Array do
70
70
  describe ".from" do
71
71
  it "creates a GArray from an array of :gint32" do
72
72
  arr = GLib::Array.from :gint32, [3, 2, 1]
73
- arr.data.read_array_of_int32(3).must_equal [3, 2, 1]
73
+ arr.data_ptr.read_array_of_int32(3).must_equal [3, 2, 1]
74
74
  end
75
75
 
76
76
  it "creates a GArray from an array of :gboolean" do
77
77
  arr = GLib::Array.from :gboolean, [true, false, true]
78
- arr.data.read_array_of_int(3).must_equal [1, 0, 1]
78
+ arr.data_ptr.read_array_of_int(3).must_equal [1, 0, 1]
79
79
  end
80
80
 
81
81
  it "return its argument if given a GArray" do
82
82
  arr = GLib::Array.new :gint32
83
83
  arr.append_vals [3, 2, 1]
84
- arr2 = GLib::Array.from :foo, arr
84
+ arr2 = GLib::Array.from :gint32, arr
85
85
  assert arr2.equal? arr
86
86
  end
87
87
 
@@ -24,7 +24,7 @@ describe GObject::RubyClosure do
24
24
  it "invokes its closure argument's block" do
25
25
  a = 0
26
26
  c = GObject::RubyClosure.new { a = 2 }
27
- GObject::RubyClosure.marshaller(c, nil, 0, nil, nil, nil)
27
+ GObject::RubyClosure.marshaller(c, nil, nil, nil, nil)
28
28
  assert_equal 2, a
29
29
  end
30
30
 
@@ -32,14 +32,14 @@ describe GObject::RubyClosure do
32
32
  a = 0
33
33
  c = GObject::RubyClosure.new { a = 2 }
34
34
  c2 = GObject::Closure.wrap(c.to_ptr)
35
- GObject::RubyClosure.marshaller(c2, nil, 0, nil, nil, nil)
35
+ GObject::RubyClosure.marshaller(c2, nil, nil, nil, nil)
36
36
  assert_equal 2, a
37
37
  end
38
38
 
39
39
  it "stores the closure's return value in the proper gvalue" do
40
40
  c = GObject::RubyClosure.new { 2 }
41
41
  gv = GObject::Value.new
42
- GObject::RubyClosure.marshaller(c, gv, 0, nil, nil, nil)
42
+ GObject::RubyClosure.marshaller(c, gv, nil, nil, nil)
43
43
  assert_equal 2, gv.get_value
44
44
  end
45
45
  end
@@ -1,6 +1,6 @@
1
1
  require 'gir_ffi_test_helper'
2
2
 
3
- require 'ffi-gobject'
3
+ GirFFI.setup :Regress
4
4
 
5
5
  describe GObject::Value do
6
6
  describe "::Struct" do
@@ -128,6 +128,20 @@ describe GObject::Value do
128
128
  gv.get_value.must_equal value
129
129
  end
130
130
 
131
+ it "unwraps an enum value" do
132
+ value = :value2
133
+ gv = GObject::Value.for_g_type Regress::TestEnum.get_gtype
134
+ gv.set_enum Regress::TestEnum[value]
135
+ gv.get_value.must_equal value
136
+ end
137
+
138
+ it "unwraps a flags value" do
139
+ value = Regress::TestFlags[:flag1] | Regress::TestFlags[:flag3]
140
+ gv = GObject::Value.for_g_type Regress::TestFlags.get_gtype
141
+ gv.set_flags value
142
+ gv.get_value.must_equal value
143
+ end
144
+
131
145
  it "unwraps a GType" do
132
146
  value = GObject::TYPE_STRING
133
147
  gv = GObject::Value.for_g_type GObject::TYPE_GTYPE