Skip to content

Commit 3025ecf

Browse files
committed
Get ready for release
1 parent e4fb4b7 commit 3025ecf

File tree

8 files changed

+99
-51
lines changed

8 files changed

+99
-51
lines changed

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ task :test do
4444
system 'jruby --dev test/aabb_spec_test.rb'
4545
system 'jruby --dev test/create_test.rb'
4646
system 'jruby --dev test/color_group_test.rb'
47+
system 'jruby --dev test/fast_noise_test.rb'
48+
system 'jruby --dev test/smooth_noise_test.rb'
4749
home = File.expand_path('~')
4850
FLF = '%<home>s/.jruby_art/config.yml'
4951
config = File.exist?(format(FLF, home: home))

lib/jruby_art.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# JRubyArt is for Code Art.
43
# Send suggestions, ideas, and hate-mail to mamba2928 [at] gmail.com
54
# Also, send samples and libraries.

test/fast_noise_test.rb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
require_relative 'test_helper'
2+
3+
Java::Monkstone::JRLibrary.new.load(JRuby.runtime, false)
4+
# method tests
5+
class NoiseTest < Minitest::Test
6+
include FastNoise
7+
8+
VALS = [0.4, 0.5, 4, 5].freeze
9+
10+
def test_noise1d
11+
assert self.respond_to? :noise
12+
result = VALS.map { |x| noise(x) }
13+
assert result.all? { |x| (-1.0..1.0).include?(x) }
14+
assert VALS.length == result.uniq.length
15+
end
16+
17+
def test_noise2d
18+
result = VALS.map { |x| noise(x, Math.sin(x)) }
19+
assert result.all? { |x| (-1.0..1.0).include?(x) }
20+
assert VALS.length == result.uniq.length
21+
end
22+
23+
def test_noise3d
24+
result = VALS.map { |x| noise(x, Math.sin(x), Math.cos(x)) }
25+
assert result.all? { |x| (-1.0..1.0).include?(x) }
26+
assert VALS.length == result.uniq.length
27+
end
28+
29+
def test_noise4d
30+
result = VALS.map { |x| noise(x, rand, Math.sin(x), Math.cos(x)) }
31+
assert result.all? { |x| (-1.0..1.0).include?(x) }
32+
assert VALS.length == result.uniq.length
33+
end
34+
35+
def test_tnoise2d
36+
result = VALS.map { |x| tnoise(x, Math.sin(x)) }
37+
assert result.all? { |x| (-1.0..1.0).include?(x) }
38+
assert VALS.length == result.uniq.length
39+
end
40+
41+
def test_tnoise3d
42+
result = VALS.map { |x| tnoise(x, Math.sin(x), Math.cos(x)) }
43+
assert result.all? { |x| (-1.0..1.0).include?(x) }
44+
assert VALS.length == result.uniq.length
45+
end
46+
47+
def test_tnoise4d
48+
result = VALS.map { |x| tnoise(x, rand, Math.sin(x), Math.cos(x)) }
49+
assert result.all? { |x| (-1.0..1.0).include?(x) }
50+
assert VALS.length == result.uniq.length
51+
end
52+
end

test/k9_run_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require_relative 'test_helper'
42

53
Dir.chdir(File.dirname(__FILE__))

test/smooth_noise_test.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
require_relative 'test_helper'
2+
3+
Java::Monkstone::JRLibrary.new.load(JRuby.runtime, false)
4+
# method tests
5+
class NoiseTest < Minitest::Test
6+
7+
VALS = [0.4, 0.5, 4, 5].freeze
8+
9+
def test_noise2d
10+
result = VALS.map { |x| SmoothNoise.noise(x, Math.sin(x)) }
11+
assert result.all? { |x| (-1.0..1.0).include?(x) }
12+
assert VALS.length == result.uniq.length
13+
end
14+
15+
def test_noise3d
16+
result = VALS.map { |x| SmoothNoise.noise(x, Math.sin(x), Math.cos(x)) }
17+
assert result.all? { |x| (-1.0..1.0).include?(x) }
18+
assert VALS.length == result.uniq.length
19+
end
20+
21+
def test_noise4d
22+
result = VALS.map { |x| SmoothNoise.noise(x, rand, Math.sin(x), Math.cos(x)) }
23+
assert result.all? { |x| (-1.0..1.0).include?(x) }
24+
assert VALS.length == result.uniq.length
25+
end
26+
27+
def test_tnoise2d
28+
result = VALS.map { |x| SmoothNoise.tnoise(x, Math.sin(x)) }
29+
assert result.all? { |x| (-1.0..1.0).include?(x) }
30+
assert VALS.length == result.uniq.length
31+
end
32+
33+
def test_tnoise3d
34+
result = VALS.map { |x| SmoothNoise.tnoise(x, Math.sin(x), Math.cos(x)) }
35+
assert result.all? { |x| (-1.0..1.0).include?(x) }
36+
assert VALS.length == result.uniq.length
37+
end
38+
39+
def test_tnoise4d
40+
result = VALS.map { |x| SmoothNoise.tnoise(x, rand, Math.sin(x), Math.cos(x)) }
41+
assert result.all? { |x| (-1.0..1.0).include?(x) }
42+
assert VALS.length == result.uniq.length
43+
end
44+
end

test/test_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
gem 'minitest' # don't use bundled minitest
44
require 'minitest/autorun'
55
require 'minitest/pride'
6-
require 'jruby'
76
require_relative '../lib/jruby_art'
87
require "#{K9_ROOT}/lib/jruby_art-#{JRubyArt::VERSION}.jar"

test/test_noise.rb

Lines changed: 0 additions & 46 deletions
This file was deleted.

vendors/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WARNING = <<~WARN
1111
1212
WARN
1313
# https://github.com/processing/processing-video/releases/download/r6-v2.0-beta4/video-2.0-beta4.zip
14-
JRUBYC_VERSION = '9.2.16.0'
14+
JRUBYC_VERSION = '9.2.17.0'
1515
SOUND = 'sound.zip'
1616
SOUND_VERSION = 'v2.2.3'
1717
VIDEO = 'video.zip'

0 commit comments

Comments
 (0)