about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-25 09:34:08 +0000
committerEric Wong <e@80x24.org>2016-02-25 09:41:27 +0000
commit83b7b3ef9582b05462b851571cf9dce44276b88c (patch)
tree83849e75ad82183550cbc04860106dae9458fca5 /test
parent1ac312ae86fb047613ff8558dd8f6ad43ae2ac59 (diff)
downloadraindrops-83b7b3ef9582b05462b851571cf9dce44276b88c.tar.gz
With invalid addresses specified which give no currently-bound
address, we must avoid leaving placeholders ('true' objects)
in our results.

Clean up some shadowing "cur" while we're at it.
Diffstat (limited to 'test')
-rw-r--r--test/test_linux.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_linux.rb b/test/test_linux.rb
index 0e79a86..bfefcc4 100644
--- a/test/test_linux.rb
+++ b/test/test_linux.rb
@@ -214,6 +214,13 @@ class TestLinux < Test::Unit::TestCase
     assert_equal 0, stats[addr1].active
     assert_equal 1, stats[addr2].queued
     assert_equal 1, stats[addr2].active
+
+    # make sure we don't leave "true" placeholders in results if a
+    # listener becomes invalid (even momentarily).
+    s2.close
+    stats = tcp_listener_stats(addrs)
+    assert stats.values.all? { |x| x.instance_of?(Raindrops::ListenStats) },
+      "placeholders left: #{stats.inspect}"
   end
 
   # tries to overflow buffers