a couple test

darcs-hash:20060624235250-28bda-abfc30e92c379496c0d7d66ca9571bbdeeb7b4d9.gz
This commit is contained in:
hans 2006-06-24 17:52:50 -06:00
parent 052f32a3f7
commit af39b88df6

View file

@ -8,12 +8,14 @@ class TC_LIRC < Test::Unit::TestCase
def teardown def teardown
end end
def test_event def test_event
e = Event.new("00000000000a8b59 00 power Sony-838") ev1 = "00000000000a8b59 00 power Sony-838"
e = Event.new(ev1)
assert_equal 0xa8b59, e.code assert_equal 0xa8b59, e.code
assert_equal 0, e.repeat assert_equal 0, e.repeat
assert ! e.repeat? assert ! e.repeat?
assert_equal "power", e.name assert_equal "power", e.name
assert_equal "Sony-838", e.remote assert_equal "Sony-838", e.remote
assert_equal ev1, e.to_s
e = Event.new("00000000000a8b59 01 power Sony-838") e = Event.new("00000000000a8b59 01 power Sony-838")
assert_equal 0xa8b59, e.code assert_equal 0xa8b59, e.code
@ -21,5 +23,14 @@ class TC_LIRC < Test::Unit::TestCase
assert e.repeat? assert e.repeat?
assert_equal "power", e.name assert_equal "power", e.name
assert_equal "Sony-838", e.remote assert_equal "Sony-838", e.remote
e = Event.new("00000000000a8b59 10 power Sony-838")
assert_equal 0x10, e.repeat
assert e.repeat?
end
def test_client
c = Client.new
puts "press a key on the remote now"
puts c.next
end end
end end