#!/usr/bin/ruby require 'test/unit' $: << File::dirname(__FILE__) require 'build_SWIG/FenrirUtil.so' class TestComportStream < Test::Unit::TestCase def setup @comport = FenrirUtil::ComportStream::new("COM91") p @comport.methods end def teardown @comport = nil GC::start # うまくdeleteがかからない? end def test_comport_read s = String::new(" " * 32) 10.times{|i| sleep(0.01) until (@comport.readsome(s, 32) > 0) p s } end def test_comport_write 10.times{|i| @comport.write $stdin.read } end end