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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +34 -0
  3. data/.github/workflows/publish.yml +34 -0
  4. data/Gemfile +3 -4
  5. data/Rakefile +32 -30
  6. data/ext/api.c +6 -1
  7. data/lib/snappy.rb +5 -5
  8. data/lib/snappy/hadoop/reader.rb +6 -2
  9. data/lib/snappy/reader.rb +11 -7
  10. data/lib/snappy/shim.rb +1 -1
  11. data/lib/snappy/version.rb +1 -1
  12. data/snappy.gemspec +13 -9
  13. data/test/hadoop/snappy_hadoop_reader_test.rb +115 -0
  14. data/test/hadoop/snappy_hadoop_writer_test.rb +48 -0
  15. data/test/snappy_hadoop_test.rb +26 -0
  16. data/test/snappy_reader_test.rb +148 -0
  17. data/test/snappy_test.rb +95 -0
  18. data/test/snappy_writer_test.rb +55 -0
  19. data/test/test_helper.rb +7 -0
  20. data/vendor/snappy/CMakeLists.txt +177 -54
  21. data/vendor/snappy/NEWS +8 -0
  22. data/vendor/snappy/README.md +19 -20
  23. data/vendor/snappy/cmake/SnappyConfig.cmake.in +33 -0
  24. data/vendor/snappy/cmake/config.h.in +6 -6
  25. data/vendor/snappy/docs/README.md +72 -0
  26. data/vendor/snappy/snappy-internal.h +12 -5
  27. data/vendor/snappy/snappy-stubs-internal.cc +1 -1
  28. data/vendor/snappy/snappy-stubs-internal.h +60 -15
  29. data/vendor/snappy/snappy-stubs-public.h.in +16 -36
  30. data/vendor/snappy/snappy-test.cc +16 -15
  31. data/vendor/snappy/snappy-test.h +12 -60
  32. data/vendor/snappy/snappy.cc +333 -187
  33. data/vendor/snappy/snappy.h +14 -10
  34. data/vendor/snappy/snappy_compress_fuzzer.cc +59 -0
  35. data/vendor/snappy/snappy_uncompress_fuzzer.cc +57 -0
  36. data/vendor/snappy/snappy_unittest.cc +220 -124
  37. metadata +25 -18
  38. data/.travis.yml +0 -31
  39. data/smoke.sh +0 -8
  40. data/test/hadoop/test-snappy-hadoop-reader.rb +0 -103
  41. data/test/hadoop/test-snappy-hadoop-writer.rb +0 -48
  42. data/test/test-snappy-hadoop.rb +0 -22
  43. data/test/test-snappy-reader.rb +0 -129
  44. data/test/test-snappy-writer.rb +0 -55
  45. data/test/test-snappy.rb +0 -58
  46. data/vendor/snappy/cmake/SnappyConfig.cmake +0 -1
@@ -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")