Kouhei Sutou
null+****@clear*****
Thu Mar 6 18:42:28 JST 2014
Kouhei Sutou 2014-03-06 18:42:28 +0900 (Thu, 06 Mar 2014) New Revision: e998c9602be6725ead95e487a86575edf3f271c6 https://github.com/ranguba/rroonga/commit/e998c9602be6725ead95e487a86575edf3f271c6 Message: test: follow ja's threshold change in Groonga Modified files: test/test-array.rb test/test-database.rb test/test-double-array-trie.rb test/test-hash.rb test/test-patricia-trie.rb Modified: test/test-array.rb (+6 -5) =================================================================== --- test/test-array.rb 2014-02-24 18:24:57 +0900 (b609ff2) +++ test/test-array.rb 2014-03-06 18:42:28 +0900 (5bdebd0) @@ -1,4 +1,4 @@ -# Copyright (C) 2009-2013 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -117,11 +117,12 @@ class ArrayTest < Test::Unit::TestCase users = Groonga::Array.create(:name => "Users") users.define_column("name", "ShortText") users.define_column("address", "ShortText") - 1000.times do |i| - users.add(:name => "user #{i}" * 1000, - :address => "address #{i}" * 1000) + large_data = "x" * (2 ** 16) + 100.times do |i| + users.add(:name => "user #{i}" + large_data, + :address => "address #{i}" + large_data) end - assert_equal(3, users.defrag) + assert_equal(2, users.defrag) end def test_rename Modified: test/test-database.rb (+6 -5) =================================================================== --- test/test-database.rb 2014-02-24 18:24:57 +0900 (ee6cc72) +++ test/test-database.rb 2014-03-06 18:42:28 +0900 (cb004d8) @@ -1,4 +1,4 @@ -# Copyright (C) 2009-2013 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -146,11 +146,12 @@ class DatabaseTest < Test::Unit::TestCase end end users = context["Users"] - 1000.times do |i| - users.add(:name => "user #{i}" * 1000, - :address => "address #{i}" * 1000) + large_data = "x" * (2 ** 16) + 100.times do |i| + users.add(:name => "user #{i}" + large_data, + :address => "address #{i}" + large_data) end - assert_equal(3, @database.defrag) + assert_equal(2, @database.defrag) end def test_tables Modified: test/test-double-array-trie.rb (+6 -5) =================================================================== --- test/test-double-array-trie.rb 2014-02-24 18:24:57 +0900 (6a49652) +++ test/test-double-array-trie.rb 2014-03-06 18:42:28 +0900 (3196a10) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2011-2012 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2011-2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -158,12 +158,13 @@ class DoubleArrayTrieTest < Test::Unit::TestCase :key_type => "ShortText") users.define_column("name", "ShortText") users.define_column("address", "ShortText") - 1000.times do |i| + large_data = "x" * (2 ** 16) + 100.times do |i| users.add("user #{i}", - :name => "user #{i}" * 1000, - :address => "address #{i}" * 1000) + :name => "user #{i}" + large_data, + :address => "address #{i}" + large_data) end - assert_equal(3, users.defrag) + assert_equal(2, users.defrag) end def test_rename Modified: test/test-hash.rb (+6 -5) =================================================================== --- test/test-hash.rb 2014-02-24 18:24:57 +0900 (bdf432d) +++ test/test-hash.rb 2014-03-06 18:42:28 +0900 (1013b80) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2013 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -367,12 +367,13 @@ class HashTest < Test::Unit::TestCase :key_type => "ShortText") users.define_column("name", "ShortText") users.define_column("address", "ShortText") - 1000.times do |i| + large_data = "x" * (2 ** 16) + 100.times do |i| users.add("user #{i}", - :name => "user #{i}" * 1000, - :address => "address #{i}" * 1000) + :name => "user #{i}" + large_data, + :address => "address #{i}" + large_data) end - assert_equal(3, users.defrag) + assert_equal(2, users.defrag) end def test_rename Modified: test/test-patricia-trie.rb (+6 -5) =================================================================== --- test/test-patricia-trie.rb 2014-02-24 18:24:57 +0900 (343c5d2) +++ test/test-patricia-trie.rb 2014-03-06 18:42:28 +0900 (84476c0) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2012 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -417,12 +417,13 @@ class PatriciaTrieTest < Test::Unit::TestCase :key_type => "ShortText") users.define_column("name", "ShortText") users.define_column("address", "ShortText") - 1000.times do |i| + large_data = "x" * (2 ** 16) + 100.times do |i| users.add("user #{i}", - :name => "user #{i}" * 1000, - :address => "address #{i}" * 1000) + :name => "user #{i}" + large_data, + :address => "address #{i}" + large_data) end - assert_equal(3, users.defrag) + assert_equal(2, users.defrag) end def test_rename -------------- next part -------------- HTML����������������������������...Download