[Groonga-commit] groonga/groonga [master] test: change not to pass the value of boolean in order to control behavior

Back to archive index

null+****@clear***** null+****@clear*****
2012年 5月 21日 (月) 12:06:41 JST


HAYASHI Kentaro	2012-05-21 12:06:41 +0900 (Mon, 21 May 2012)

  New Revision: 31de03618e71cce4468b3d0275573164a3dc7326

  Log:
    test: change not to pass the value of boolean in order to control behavior

  Modified files:
    test/function/tools/geo/generate-grntest-data.rb

  Modified: test/function/tools/geo/generate-grntest-data.rb (+24 -12)
===================================================================
--- test/function/tools/geo/generate-grntest-data.rb    2012-05-21 14:26:40 +0900 (1f35574)
+++ test/function/tools/geo/generate-grntest-data.rb    2012-05-21 12:06:41 +0900 (010e935)
@@ -245,32 +245,36 @@ class GrnTestData
     @latitude_start_degree == @latitude_end_degree
   end
 
-  def to_north?(check_longitude=true)
-    if check_longitude
+  def to_north?(check_option=nil)
+    check_option ||= {:check_longitude => true}
+    if check_option[:check_longitude] == true
       longitude_equal? and @latitude_start_degree < @latitude_end_degree
     else
       @latitude_start_degree < @latitude_end_degree
     end
   end
 
-  def to_east?(check_latitude=true)
-    if check_latitude
+  def to_east?(check_option=nil)
+    check_option ||= {:check_latitude => true}
+    if check_option[:check_latitude] == true
       latitude_equal? and @longitude_start_degree < @longitude_end_degree
     else
       @longitude_start_degree < @longitude_end_degree
     end
   end
 
-  def to_west?(check_latitude=true)
-    if check_latitude
+  def to_west?(check_option=nil)
+    check_option ||= {:check_latitude => true}
+    if check_option[:check_latitude] == true
       latitude_equal? and @longitude_start_degree > @longitude_end_degree
     else
       @longitude_start_degree > @longitude_end_degree
     end
   end
 
-  def to_south?(check_longitude=true)
-    if check_longitude
+  def to_south?(check_option=nil)
+    check_option ||= {:check_longitude => true}
+    if check_option[:check_longitude] == true
       longitude_equal? and @latitude_start_degree > @latitude_end_degree
     else
       @latitude_start_degree > @latitude_end_degree
@@ -278,19 +282,27 @@ class GrnTestData
   end
 
   def to_north_east?
-    to_north?(false) and to_east?(false)
+    check_longitude = {:check_longitude => false}
+    check_latitude = {:check_latitude => false}
+    to_north?(check_longitude) and to_east?(check_latitude)
   end
 
   def to_north_west?
-    to_north?(false) and to_west?(false)
+    check_longitude = {:check_longitude => false}
+    check_latitude = {:check_latitude => false}
+    to_north?(check_longitude) and to_west?(check_latitude)
   end
 
   def to_south_east?
-    to_south?(false) and to_east?(false)
+    check_longitude = {:check_longitude => false}
+    check_latitude = {:check_latitude => false}
+    to_south?(check_longitude) and to_east?(check_latitude)
   end
 
   def to_south_west?
-    to_south?(false) and to_west?(false)
+    check_longitude = {:check_longitude => false}
+    check_latitude = {:check_latitude => false}
+    to_south?(check_longitude) and to_west?(check_latitude)
   end
 
   def direction




Groonga-commit メーリングリストの案内
Back to archive index