1 require "#{File.dirname(__FILE__)}/../test_helper"
4 class TestTypeDB < Test::Unit::TestCase
7 assert_instance_of Module, LWES, "LWES is not a module"
8 assert_instance_of Class, LWES::TypeDB, "LWES::TypeDB is not a class"
12 assert_nothing_raised do
13 LWES::TypeDB.new("#{File.dirname(__FILE__)}/test1.esf")
17 def TODO_test_raises_on_parse_error
18 # tmp_err = $stderr.dup
19 # $stderr.reopen("/dev/null", "a")
21 LWES::TypeDB.new(__FILE__)
26 # $stderr.reopen(tmp_err)
32 :SenderPort => LWES::U_INT_16,
35 :SiteID => LWES::U_INT_16,
36 :ReceiptTime => LWES::INT_64,
37 :SenderIP => LWES::IP_ADDR
40 :t_ip_addr => LWES::IP_ADDR,
41 :t_bool => LWES::BOOLEAN,
42 :t_uint64 => LWES::U_INT_64,
43 :t_uint32 => LWES::U_INT_32,
44 :t_int64 => LWES::INT_64,
45 :t_string => LWES::STRING,
46 :t_int32 => LWES::INT_32,
47 :t_uint16 => LWES::U_INT_16,
48 :t_int16 => LWES::INT_16
51 result = LWES::TypeDB.new("#{File.dirname(__FILE__)}/test1.esf").to_hash
52 assert_equal expect, result