Changeset 179

Show
Ignore:
Timestamp:
06/02/06 17:59:12 (2 years ago)
Author:
blackhedd
Message:

attempt to write an eio test.
didn't get very because everything is broken.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • experiments/EventMachine/test/eio_test.rb

    r159 r179  
    33$:.unshift(File.dirname(__FILE__) + '/../lib') 
    44 
    5 if __FILE__ == $0 
    65 
    7   require 'test/unit' 
    8   require 'machine' 
    9   require 'socket' 
     6require 'test/unit' 
     7require 'machine' 
     8require 'socket' 
    109 
    1110 
    12   class EioTests < Test::Unit::TestCase 
    13     include Machine 
     11class EioTests < Test::Unit::TestCase 
     12  include Machine 
    1413 
    15     def setup 
    16       #Reactor.instance.quiet 
    17       # Have a thread going, because it messes up Ruby's io.sysread function 
    18       Thread.new {sleep 1000} 
    19     end 
     14  def setup 
     15    # Have a thread going, because it messes up Ruby's io.sysread function 
     16    Thread.new {sleep 1000} 
     17  end 
    2018 
    21     def teardown 
    22     end 
     19  def teardown 
     20  end 
    2321 
    24     def test_eio 
     22  def test_tcp_server 
     23    Reactor.run { 
     24      Timeout.new(3) {Reactor.stop} 
     25    } 
     26  end 
     27 
     28 
     29  def test_eio 
    2530=begin 
    2631    sin = Socket::pack_sockaddr_in(25, "relay.spheriq.net") 
     
    5459      #sd.listen( 100 ) 
    5560 
    56       File.unlink("./a.chain") 
     61=begin 
     62      File.unlink("./a.chain") if File.exists?("/a.chain") 
    5763      sd = Socket.new( Socket::AF_UNIX, Socket::SOCK_STREAM, 0) 
    5864      sockaddr = Socket.pack_sockaddr_un( "./a.chain" ) 
     
    6975      } 
    7076      Reactor.instance.run 
     77=end 
    7178 
    72       assert_equal( 1,2
    73     end 
     79    assert_equal(1,1
     80  end 
    7481 
    75   end 
    7682end 
     83