lwes 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +3 -0
- data/Rakefile +1 -0
- data/ext/lwes/emitter.c +1 -1
- data/lib/lwes.rb +2 -2
- data/lwes.gemspec +1 -1
- data/test/unit/test_emitter.rb +1 -1
- data/test/unit/test_struct.rb +12 -12
- metadata +1 -1
data/ChangeLog
CHANGED
data/Rakefile
CHANGED
data/ext/lwes/emitter.c
CHANGED
@@ -310,7 +310,7 @@ static VALUE emitter_emit(int argc, VALUE *argv, VALUE self)
|
|
310
310
|
case T_STRING:
|
311
311
|
if (TYPE(event) == T_HASH)
|
312
312
|
return emit_hash(self, name, event);
|
313
|
-
rb_raise(
|
313
|
+
rb_raise(rb_eTypeError,
|
314
314
|
"second argument must be a hash when first "
|
315
315
|
"is a String");
|
316
316
|
case T_STRUCT:
|
data/lib/lwes.rb
CHANGED
data/lwes.gemspec
CHANGED
data/test/unit/test_emitter.rb
CHANGED
@@ -109,7 +109,7 @@ class TestEmitter < Test::Unit::TestCase
|
|
109
109
|
assert_equal 1, lines.grep(/\bip = 192.168.1.1/).size
|
110
110
|
end
|
111
111
|
|
112
|
-
def
|
112
|
+
def test_emit_junk
|
113
113
|
emitter = LWES::Emitter.new(@options)
|
114
114
|
assert_raises(ArgumentError) { emitter.emit("JUNK", :junk => %r{junk}) }
|
115
115
|
end
|
data/test/unit/test_struct.rb
CHANGED
@@ -63,10 +63,10 @@ class TestStruct < Test::Unit::TestCase
|
|
63
63
|
}
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
66
|
+
def test_new_with_type_db
|
67
67
|
type_db = LWES::TypeDB.new(ESF_FILE)
|
68
68
|
assert type_db.instance_of?(LWES::TypeDB)
|
69
|
-
a = LWES::Struct.new(:db=>type_db, :class
|
69
|
+
a = LWES::Struct.new(:db=>type_db, :class=>:TypeDB_Event, :name=>:Event1)
|
70
70
|
assert a.instance_of?(Class)
|
71
71
|
assert_equal "TypeDB_Event", a.name
|
72
72
|
assert a.const_get(:TYPE_DB).instance_of?(LWES::TypeDB)
|
@@ -78,7 +78,7 @@ class TestStruct < Test::Unit::TestCase
|
|
78
78
|
assert_kind_of(::Struct, y)
|
79
79
|
end
|
80
80
|
|
81
|
-
def
|
81
|
+
def test_new_with_defaults_hash
|
82
82
|
a = LWES::Struct.new(:file=>ESF_FILE)
|
83
83
|
assert a.instance_of?(Class)
|
84
84
|
assert_equal "Event1", a.name
|
@@ -165,15 +165,15 @@ class TestStruct < Test::Unit::TestCase
|
|
165
165
|
:class=> :LWES_New,
|
166
166
|
:name=>:Event1)
|
167
167
|
y = LWES_Foo.new(true, -16, -32, -64, "127.0.0.1", "HI", 16, 32, 64)
|
168
|
-
assert_equal
|
169
|
-
assert_equal
|
170
|
-
assert_equal
|
171
|
-
assert_equal
|
172
|
-
assert_equal
|
173
|
-
assert_equal
|
174
|
-
assert_equal
|
175
|
-
assert_equal
|
176
|
-
assert_equal
|
168
|
+
assert_equal(true, y.t_bool)
|
169
|
+
assert_equal(-16, y.t_int16)
|
170
|
+
assert_equal(-32, y.t_int32)
|
171
|
+
assert_equal(-64, y.t_int64)
|
172
|
+
assert_equal("127.0.0.1", y.t_ip_addr)
|
173
|
+
assert_equal("HI", y.t_string)
|
174
|
+
assert_equal(16, y.t_uint16)
|
175
|
+
assert_equal(32, y.t_uint32)
|
176
|
+
assert_equal(64, y.t_uint64)
|
177
177
|
end
|
178
178
|
|
179
179
|
def test_skip_attr
|