diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-09-01 16:21:35 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-09-01 16:45:22 -0700 |
commit | bb221fa8e214605ead838b51cee443388b2c2f14 (patch) | |
tree | 93ea67596b79e10779dc75440919960046b59f77 /test/test_gc.rb | |
parent | d993ccd8f8846baa5434ab72bc8c159343baae79 (diff) | |
download | rpatricia-bb221fa8e214605ead838b51cee443388b2c2f14.tar.gz |
return Patricia::Node objects when returning nodes
This prevents improper dereferencing and segfaults if the code is misused. Instead NoMethodError should be raised when it would previously segfault.
Diffstat (limited to 'test/test_gc.rb')
-rw-r--r-- | test/test_gc.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_gc.rb b/test/test_gc.rb index d567696..5829deb 100644 --- a/test/test_gc.rb +++ b/test/test_gc.rb @@ -17,7 +17,7 @@ class TestGc < Test::Unit::TestCase def test_gc assert_nothing_raised do - 10_000_000.times do + 5_000_000.times do t = Patricia.new t.add('10.0.0.0/8', {}) t.add('127.0.0.0/24', "home sweet home") @@ -25,7 +25,7 @@ class TestGc < Test::Unit::TestCase end # ensure what we created originally didn't get GC-ed' - 100.times do + 5_000_000.times do assert_equal [], @arrays.match_best('127.0.0.1').data assert_equal "localhost", @strings.match_best('127.0.0.1').data end |