snappy 0.1.0-java → 0.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +34 -0
- data/.github/workflows/publish.yml +34 -0
- data/Gemfile +3 -4
- data/Rakefile +32 -30
- data/ext/api.c +6 -1
- data/lib/snappy.rb +5 -5
- data/lib/snappy/hadoop/reader.rb +6 -2
- data/lib/snappy/reader.rb +11 -7
- data/lib/snappy/shim.rb +1 -1
- data/lib/snappy/version.rb +1 -1
- data/snappy.gemspec +13 -9
- data/test/hadoop/snappy_hadoop_reader_test.rb +115 -0
- data/test/hadoop/snappy_hadoop_writer_test.rb +48 -0
- data/test/snappy_hadoop_test.rb +26 -0
- data/test/snappy_reader_test.rb +148 -0
- data/test/snappy_test.rb +95 -0
- data/test/snappy_writer_test.rb +55 -0
- data/test/test_helper.rb +7 -0
- data/vendor/snappy/CMakeLists.txt +177 -54
- data/vendor/snappy/NEWS +8 -0
- data/vendor/snappy/README.md +19 -20
- data/vendor/snappy/cmake/SnappyConfig.cmake.in +33 -0
- data/vendor/snappy/cmake/config.h.in +6 -6
- data/vendor/snappy/docs/README.md +72 -0
- data/vendor/snappy/snappy-internal.h +12 -5
- data/vendor/snappy/snappy-stubs-internal.cc +1 -1
- data/vendor/snappy/snappy-stubs-internal.h +60 -15
- data/vendor/snappy/snappy-stubs-public.h.in +16 -36
- data/vendor/snappy/snappy-test.cc +16 -15
- data/vendor/snappy/snappy-test.h +12 -60
- data/vendor/snappy/snappy.cc +333 -187
- data/vendor/snappy/snappy.h +14 -10
- data/vendor/snappy/snappy_compress_fuzzer.cc +59 -0
- data/vendor/snappy/snappy_uncompress_fuzzer.cc +57 -0
- data/vendor/snappy/snappy_unittest.cc +220 -124
- metadata +25 -18
- data/.travis.yml +0 -31
- data/smoke.sh +0 -8
- data/test/hadoop/test-snappy-hadoop-reader.rb +0 -103
- data/test/hadoop/test-snappy-hadoop-writer.rb +0 -48
- data/test/test-snappy-hadoop.rb +0 -22
- data/test/test-snappy-reader.rb +0 -129
- data/test/test-snappy-writer.rb +0 -55
- data/test/test-snappy.rb +0 -58
- data/vendor/snappy/cmake/SnappyConfig.cmake +0 -1
data/test/test-snappy.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
require 'minitest/spec'
|
3
|
-
require 'snappy'
|
4
|
-
|
5
|
-
describe Snappy do
|
6
|
-
T = [*'a'..'z', *'A'..'Z', *'0'..'9']
|
7
|
-
|
8
|
-
it 'well done' do
|
9
|
-
s = Array.new(1024){T.sample}.join
|
10
|
-
Snappy.inflate(Snappy.deflate s).must_equal(s)
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'well done (pair)' do
|
14
|
-
s = Array.new(1024){T.sample}.join
|
15
|
-
[
|
16
|
-
[:deflate, :inflate],
|
17
|
-
[:compress, :uncompress],
|
18
|
-
[:dump, :load],
|
19
|
-
].each do |(i, o)|
|
20
|
-
Snappy.__send__(o, (Snappy.__send__ i, s)).must_equal(s)
|
21
|
-
eval %{Snappy.#{o}(Snappy.#{i} s).must_equal(s)}
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#deflate' do
|
26
|
-
it 'can pass buffer' do
|
27
|
-
skip 'cannot pass buffer in jruby' if defined? JRUBY_VERSION
|
28
|
-
s = 'a' * 1024
|
29
|
-
d = ' ' * 1024
|
30
|
-
r = Snappy.deflate(s, d)
|
31
|
-
d.must_be_same_as r
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '#inflate' do
|
36
|
-
it 'can pass buffer' do
|
37
|
-
skip 'cannot pass buffer in jruby' if defined? JRUBY_VERSION
|
38
|
-
s = Snappy.deflate('a' * 1024)
|
39
|
-
d = ' ' * 1024
|
40
|
-
r = Snappy.inflate(s, d)
|
41
|
-
d.must_be_same_as r
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe '#valid?' do
|
46
|
-
it 'return true when passed deflated data' do
|
47
|
-
skip 'snappy-jars does not have valid?' if defined? JRUBY_VERSION
|
48
|
-
d = Snappy.deflate(Array.new(1024){T.sample}.join)
|
49
|
-
Snappy.valid?(d).must_equal true
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'return false when passed invalid data' do
|
53
|
-
skip 'snappy-jars does not have valid?' if defined? JRUBY_VERSION
|
54
|
-
d = Snappy.deflate(Array.new(1024){T.sample}.join).reverse
|
55
|
-
Snappy.valid?(d).must_equal false
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
include("${CMAKE_CURRENT_LIST_DIR}/SnappyTargets.cmake")
|