Sha256: 9d90a952a51fc5f11341b9c2a1e1cc8704ad5bcc5a6d57b583fd23574b00e4d1

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

require File.expand_path('../test_helper.rb', File.dirname(__FILE__))

describe GObjectIntrospection::IConstantInfo do
  describe "for GLib::USEC_PER_SEC, a constant of type :gint32" do
    before do
      @info = get_introspection_data 'GLib', 'USEC_PER_SEC'
    end

    it "returns :gint32 as its type" do
      assert_equal :gint32, @info.constant_type.tag
    end

    it "returns a value union with member :v_int32 with value 1_000_000" do
      assert_equal 1_000_000, @info.value_union[:v_int32]
    end

    it "returns 1 as its value" do
      assert_equal 1_000_000, @info.value
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.4.0 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.3.2 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.3.1 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.3.0 test/ffi-gobject_introspection/i_constant_info_test.rb