Blob Blame History Raw
From 915f971a4e1cd529f01221ea20484fcdef176f7b Mon Sep 17 00:00:00 2001
From: Kouhei Sutou <kou@clear-code.com>
Date: Fri, 17 Jan 2014 23:30:44 +0900
Subject: [PATCH 1/2] gi test: maybe fix test failure on i686

GitHub: fix #216

Reported by mtasaka. Thanks!!!
---
 gobject-introspection/test/test-struct-info.rb | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/gobject-introspection/test/test-struct-info.rb b/gobject-introspection/test/test-struct-info.rb
index aef5578..852b82c 100644
--- a/gobject-introspection/test/test-struct-info.rb
+++ b/gobject-introspection/test/test-struct-info.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2012  Ruby-GNOME2 Project Team
+# Copyright (C) 2012-2014  Ruby-GNOME2 Project Team
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -40,11 +40,15 @@ class TestStructInfo < Test::Unit::TestCase
   end
 
   def test_size
-    assert_equal(24, @info.size)
+    need_ruby_2_0
+    need_fiddle
+    assert_equal(16 + Fiddle::SIZEOF_SIZE_T, @info.size)
   end
 
   def test_alignment
-    assert_equal(8, @info.alignment)
+    need_ruby_2_0
+    need_fiddle
+    assert_equal(Fiddle::ALIGN_SIZE_T, @info.alignment)
   end
 
   def test_gtype_struct?
@@ -54,4 +58,19 @@ class TestStructInfo < Test::Unit::TestCase
   def test_foreign?
     assert_false(@info.foreign?)
   end
+
+  private
+  def need_ruby_2_0
+    if RUBY_VERSION < "2.0.0"
+      omit("need Ruby 2.0.0 or later")
+    end
+  end
+
+  def need_fiddle
+    begin
+      require "fiddle"
+    rescue LoadError
+      omit("need fiddle")
+    end
+  end
 end
-- 
1.8.5.2

From cceea586f6e278c91e1aa0ae3f1ffdb10a5272a5 Mon Sep 17 00:00:00 2001
From: Kouhei Sutou <kou@clear-code.com>
Date: Sun, 19 Jan 2014 14:03:53 +0900
Subject: [PATCH 2/2] gi test: loose test strictness to work on i686, x86_64
 and armv7hl

GitHub: really fix #216

Reported by mtasaka. Thanks!!!
---
 gobject-introspection/test/test-struct-info.rb | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/gobject-introspection/test/test-struct-info.rb b/gobject-introspection/test/test-struct-info.rb
index 852b82c..c5439a1 100644
--- a/gobject-introspection/test/test-struct-info.rb
+++ b/gobject-introspection/test/test-struct-info.rb
@@ -40,15 +40,11 @@ class TestStructInfo < Test::Unit::TestCase
   end
 
   def test_size
-    need_ruby_2_0
-    need_fiddle
-    assert_equal(16 + Fiddle::SIZEOF_SIZE_T, @info.size)
+    assert_operator(@info.size, :>=, 20)
   end
 
   def test_alignment
-    need_ruby_2_0
-    need_fiddle
-    assert_equal(Fiddle::ALIGN_SIZE_T, @info.alignment)
+    assert_operator(@info.alignment, :>=, 4)
   end
 
   def test_gtype_struct?
@@ -58,19 +54,4 @@ class TestStructInfo < Test::Unit::TestCase
   def test_foreign?
     assert_false(@info.foreign?)
   end
-
-  private
-  def need_ruby_2_0
-    if RUBY_VERSION < "2.0.0"
-      omit("need Ruby 2.0.0 or later")
-    end
-  end
-
-  def need_fiddle
-    begin
-      require "fiddle"
-    rescue LoadError
-      omit("need fiddle")
-    end
-  end
 end
-- 
1.8.5.3