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 CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.3.1 (erik-s-chang)
2
+ * fix tests and enable Ruby warnings for tests
3
+
1
4
  Version 0.3.0 (erik-s-chang)
2
5
  * attempt memory allocation failure handling by invoking Ruby GC
3
6
  * corner-case fixes for copying TypeDB and Emitter objects
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ desc "run unit tests"
7
7
  Rake::TestTask.new('test:unit') do |t|
8
8
  t.libs << "ext/lwes"
9
9
  t.test_files = FileList['test/unit/test_*.rb']
10
+ t.warning = true
10
11
  t.verbose = true if ENV["VERBOSE"].to_i > 0
11
12
  end
12
13
 
@@ -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(rb_eArgError,
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:
@@ -1,6 +1,6 @@
1
1
  module LWES
2
- # version of our library, currently 0.3.0
3
- VERSION = "0.3.0"
2
+ # version of our library, currently 0.3.1
3
+ VERSION = "0.3.1"
4
4
 
5
5
  autoload :TypeDB, "lwes/type_db"
6
6
  autoload :Struct, "lwes/struct"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{lwes}
3
- s.version = "0.3.0"
3
+ s.version = "0.3.1"
4
4
  s.date = Time.now
5
5
  s.authors = ["Erik S. Chang", "Frank Maritato"]
6
6
  s.email = %q{lwes-devel@lists.sourceforge.net}
@@ -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 test_emit_invalid
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
@@ -63,10 +63,10 @@ class TestStruct < Test::Unit::TestCase
63
63
  }
64
64
  end
65
65
 
66
- def test_new_with_defaults
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 => :TypeDB_Event)
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 test_new_with_defaults
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 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
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lwes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik S. Chang