extlzma 0.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/HISTORY.ja.md +29 -0
- data/LICENSE +26 -0
- data/README.md +44 -0
- data/Rakefile +212 -0
- data/examples/01-easy_using.rb +58 -0
- data/examples/02-streaming.rb +71 -0
- data/ext/consts.c +68 -0
- data/ext/error.c +77 -0
- data/ext/extconf.rb +27 -0
- data/ext/extlzma.c +97 -0
- data/ext/extlzma.h +177 -0
- data/ext/filter.c +517 -0
- data/ext/index.c +81 -0
- data/ext/stream.c +432 -0
- data/ext/utils.c +105 -0
- data/gemstub.rb +17 -0
- data/lib/2.0/extlzma.so +0 -0
- data/lib/2.1/extlzma.so +0 -0
- data/lib/2.2/extlzma.so +0 -0
- data/lib/2.3/extlzma.so +0 -0
- data/lib/extlzma.rb +529 -0
- data/lib/extlzma/version.rb +3 -0
- data/test/sampledata.rb +15 -0
- data/test/test_extlzma.rb +58 -0
- metadata +101 -0
data/test/sampledata.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
SMALLSIZE = 400
|
2
|
+
BIGSIZE = 12000000
|
3
|
+
|
4
|
+
SAMPLES = {
|
5
|
+
"empty" => "",
|
6
|
+
"\\0 (small size)" => "\0".b * SMALLSIZE,
|
7
|
+
"\\0 (big size)" => "\0".b * BIGSIZE,
|
8
|
+
"\\xaa (small size)" => "\xaa".b * SMALLSIZE,
|
9
|
+
"\\xaa (big size)" => "\xaa".b * BIGSIZE,
|
10
|
+
"random (small size)" => OpenSSL::Random.random_bytes(SMALLSIZE),
|
11
|
+
"random (big size)" => OpenSSL::Random.random_bytes(BIGSIZE),
|
12
|
+
}
|
13
|
+
|
14
|
+
SAMPLES["freebsd ports index"] = File.read("/usr/ports/INDEX-10", mode: "rb") rescue nil # if on FreeBSD
|
15
|
+
SAMPLES["freebsd kernel"] = File.read("/boot/kernel/kernel", mode: "rb") rescue nil # if on FreeBSD
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#!ruby
|
2
|
+
|
3
|
+
=begin
|
4
|
+
# 必要と思われる試験項目
|
5
|
+
|
6
|
+
* LZMA.encode
|
7
|
+
* LZMA.decode で伸長できるか
|
8
|
+
* lz4-cli で伸長できるか
|
9
|
+
* 汚染状態の伝搬
|
10
|
+
* security level
|
11
|
+
* LZMA.encode_file
|
12
|
+
* LZMA.decode_file で伸長できるか
|
13
|
+
* lz4-cli で伸長できるか
|
14
|
+
* LZMA.decode
|
15
|
+
* LZMA.decode_file
|
16
|
+
* LZMA.test_file
|
17
|
+
|
18
|
+
* 試験で用いる試料
|
19
|
+
* /usr/ports/INDEX-10
|
20
|
+
* /boot/kernel/kernel
|
21
|
+
* 長さ 0 の空データ
|
22
|
+
* 0 で埋められた小さなデータ
|
23
|
+
* 0 で埋められたでかいデータ
|
24
|
+
* 0xaa で埋められた小さなデータ
|
25
|
+
* 0xaa で埋められたでかいデータ
|
26
|
+
* /dev/random (4000 bytes)
|
27
|
+
* /dev/random (12000000 bytes)
|
28
|
+
* 可能であれば数十 GB レベルのファイル
|
29
|
+
=end
|
30
|
+
|
31
|
+
require "test-unit"
|
32
|
+
require "openssl" # for OpenSSL::Random.random_bytes
|
33
|
+
require "extlzma"
|
34
|
+
|
35
|
+
require_relative "sampledata"
|
36
|
+
|
37
|
+
class TestStreamAPI < Test::Unit::TestCase
|
38
|
+
SAMPLES.each_pair do |name, data|
|
39
|
+
define_method("test_encode_decode_sample:#{name}", -> {
|
40
|
+
assert(data, LZMA.decode(LZMA.encode(data)))
|
41
|
+
})
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_encode_args
|
45
|
+
assert_kind_of(LZMA::Encoder, LZMA.encode)
|
46
|
+
assert_kind_of(LZMA::Encoder, LZMA.encode(StringIO.new("")))
|
47
|
+
assert_kind_of(String, LZMA.encode { |e| e.outport })
|
48
|
+
io = StringIO.new("")
|
49
|
+
assert_same(io, LZMA.encode(io) { |e| io })
|
50
|
+
assert_kind_of(LZMA::Encoder, LZMA.encode(io, 9))
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_decode_args
|
54
|
+
assert_raise(ArgumentError) { LZMA.decode }
|
55
|
+
assert_raise(NoMethodError) { LZMA.decode(nil).read } # undefined method `read' for nil:NilClass
|
56
|
+
assert_raise(LZMA::BufError) { LZMA.decode("") } # read error (or already EOF)
|
57
|
+
end
|
58
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: extlzma
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.4'
|
5
|
+
platform: x86-mingw32
|
6
|
+
authors:
|
7
|
+
- dearblue
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '11.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '11.0'
|
27
|
+
description: 'ruby bindings for liblzma in the xz utilities <http://tukaani.org/xz/>
|
28
|
+
|
29
|
+
'
|
30
|
+
email: dearblue@users.osdn.me
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files:
|
34
|
+
- HISTORY.ja.md
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- ext/consts.c
|
38
|
+
- ext/error.c
|
39
|
+
- ext/extlzma.c
|
40
|
+
- ext/extlzma.h
|
41
|
+
- ext/filter.c
|
42
|
+
- ext/index.c
|
43
|
+
- ext/stream.c
|
44
|
+
- ext/utils.c
|
45
|
+
- lib/extlzma.rb
|
46
|
+
- lib/extlzma/version.rb
|
47
|
+
files:
|
48
|
+
- HISTORY.ja.md
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- examples/01-easy_using.rb
|
53
|
+
- examples/02-streaming.rb
|
54
|
+
- ext/consts.c
|
55
|
+
- ext/error.c
|
56
|
+
- ext/extconf.rb
|
57
|
+
- ext/extlzma.c
|
58
|
+
- ext/extlzma.h
|
59
|
+
- ext/filter.c
|
60
|
+
- ext/index.c
|
61
|
+
- ext/stream.c
|
62
|
+
- ext/utils.c
|
63
|
+
- gemstub.rb
|
64
|
+
- lib/2.0/extlzma.so
|
65
|
+
- lib/2.1/extlzma.so
|
66
|
+
- lib/2.2/extlzma.so
|
67
|
+
- lib/2.3/extlzma.so
|
68
|
+
- lib/extlzma.rb
|
69
|
+
- lib/extlzma/version.rb
|
70
|
+
- test/sampledata.rb
|
71
|
+
- test/test_extlzma.rb
|
72
|
+
homepage: https://osdn.jp/projects/rutsubo/
|
73
|
+
licenses:
|
74
|
+
- BSD-2-Clause
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options:
|
78
|
+
- "--charset"
|
79
|
+
- UTF-8
|
80
|
+
- "-m"
|
81
|
+
- README.md
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '2.0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.6.2
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: ruby bindings for liblzma in the xz utilities
|
100
|
+
test_files: []
|
101
|
+
has_rdoc:
|