lz4-ruby 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -59,7 +59,7 @@ static VALUE lz4_ruby_uncompress(VALUE self, VALUE source) {
59
59
  | ((src_p[2] & 0xffU) << 8)
60
60
  | (src_p[3] & 0xffU);
61
61
 
62
- result = rb_str_new(NULL, buf_size + 1);
62
+ result = rb_str_new(NULL, buf_size);
63
63
  buf = RSTRING_PTR(result);
64
64
 
65
65
  read_bytes = LZ4_uncompress(src_p + 4, buf, buf_size);
@@ -67,8 +67,6 @@ static VALUE lz4_ruby_uncompress(VALUE self, VALUE source) {
67
67
  rb_raise(lz4_error, "Compressed data is maybe corrupted.");
68
68
  }
69
69
 
70
- buf[buf_size] = '\0';
71
-
72
70
  return result;
73
71
  }
74
72
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "lz4-ruby"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["KOMIYA Atsushi"]
12
- s.date = "2012-06-03"
12
+ s.date = "2012-06-04"
13
13
  s.description = "Ruby bindings for LZ4."
14
14
  s.email = "komiya.atsushi@gmail.com"
15
15
  s.extensions = ["ext/extconf.rb"]
@@ -11,6 +11,7 @@ require 'test/unit'
11
11
  require 'shoulda'
12
12
 
13
13
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'ext'))
14
15
  $LOAD_PATH.unshift(File.dirname(__FILE__))
15
16
  require 'lz4-ruby'
16
17
 
@@ -1,7 +1,16 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestLz4Ruby < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
4
+ context "LZ4::compress" do
5
+ 257.times do |t|
6
+ len = t + 1
7
+ text = "a" * len
8
+
9
+ should "text of #{len} \"a\"'s" do
10
+ compressed = LZ4::compress(text)
11
+ uncompressed = LZ4::uncompress(compressed)
12
+ assert_equal(text, uncompressed)
13
+ end
14
+ end
6
15
  end
7
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lz4-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-03 00:00:00.000000000 Z
12
+ date: 2012-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: -327617105
119
+ hash: 492549213
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements: