rmagick 2.15.3 → 2.15.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.editorconfig +14 -0
- data/.rubocop.yml +27 -3
- data/.travis.yml +9 -6
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +10 -0
- data/README.textile +4 -0
- data/before_install_linux.sh +4 -4
- data/doc/ex/gravity.rb +2 -1
- data/ext/RMagick/extconf.rb +60 -17
- data/lib/rmagick/version.rb +1 -1
- data/lib/rvg/clippath.rb +37 -36
- data/lib/rvg/container.rb +106 -107
- data/lib/rvg/deep_equal.rb +46 -48
- data/lib/rvg/describable.rb +35 -36
- data/lib/rvg/embellishable.rb +384 -380
- data/lib/rvg/misc.rb +705 -690
- data/lib/rvg/paint.rb +39 -40
- data/lib/rvg/pathdata.rb +120 -121
- data/lib/rvg/rvg.rb +212 -209
- data/lib/rvg/stretchable.rb +159 -158
- data/lib/rvg/stylable.rb +99 -100
- data/lib/rvg/text.rb +0 -1
- data/lib/rvg/transformable.rb +110 -110
- data/lib/rvg/units.rb +58 -58
- data/rmagick.gemspec +1 -1
- data/spec/rmagick/image/blue_shift_spec.rb +16 -0
- data/spec/rmagick/image/composite_spec.rb +140 -0
- data/spec/rmagick/image/constitute_spec.rb +15 -0
- data/spec/rmagick/image/dispatch_spec.rb +18 -0
- data/spec/rmagick/image/from_blob_spec.rb +14 -0
- data/spec/rmagick/image/ping_spec.rb +14 -0
- data/spec/rmagick/image/properties_spec.rb +29 -0
- data/spec/spec_helper.rb +3 -0
- data/test/Image1.rb +524 -718
- data/test/Image2.rb +1262 -1262
- data/test/Image3.rb +973 -973
- data/test/ImageList2.rb +341 -341
- data/test/Image_attributes.rb +678 -678
- data/test/Info.rb +336 -336
- data/test/Magick.rb +245 -242
- data/test/Pixel.rb +105 -105
- data/test/Preview.rb +42 -42
- metadata +21 -6
data/test/Magick.rb
CHANGED
@@ -30,287 +30,290 @@ class Magick::AnchorType
|
|
30
30
|
end
|
31
31
|
|
32
32
|
class Magick_UT < Test::Unit::TestCase
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
Magick.colors {|c| assert_instance_of(Magick::Color, c) }
|
44
|
-
end
|
45
|
-
|
46
|
-
# Test a few of the @@enumerator arrays in the Enum subclasses.
|
47
|
-
# No need to test all of them.
|
48
|
-
def test_enumerators
|
49
|
-
ary = nil
|
50
|
-
assert_nothing_raised do
|
51
|
-
ary = Magick::AlphaChannelType.enumerators
|
52
|
-
end
|
53
|
-
assert_instance_of(Array, ary)
|
54
|
-
|
55
|
-
assert_nothing_raised do
|
56
|
-
ary = Magick::AlignType.enumerators
|
57
|
-
end
|
58
|
-
assert_instance_of(Array, ary)
|
59
|
-
assert_equal(4, ary.length)
|
60
|
-
|
61
|
-
assert_nothing_raised do
|
62
|
-
ary = Magick::AnchorType.enumerators
|
63
|
-
end
|
64
|
-
assert_instance_of(Array, ary)
|
65
|
-
assert_equal(3, ary.length)
|
33
|
+
def test_colors
|
34
|
+
res = nil
|
35
|
+
assert_nothing_raised { res = Magick.colors }
|
36
|
+
assert_instance_of(Array, res)
|
37
|
+
res.each do |c|
|
38
|
+
assert_instance_of(Magick::Color, c)
|
39
|
+
assert_instance_of(String, c.name)
|
40
|
+
assert_instance_of(Magick::ComplianceType, c.compliance)
|
41
|
+
assert_instance_of(Magick::Pixel, c.color)
|
66
42
|
end
|
43
|
+
Magick.colors {|c| assert_instance_of(Magick::Color, c) }
|
44
|
+
end
|
67
45
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
46
|
+
# Test a few of the @@enumerator arrays in the Enum subclasses.
|
47
|
+
# No need to test all of them.
|
48
|
+
def test_enumerators
|
49
|
+
ary = nil
|
50
|
+
assert_nothing_raised do
|
51
|
+
ary = Magick::AlphaChannelType.enumerators
|
72
52
|
end
|
53
|
+
assert_instance_of(Array, ary)
|
73
54
|
|
74
|
-
|
75
|
-
|
76
|
-
assert_nothing_raised { res = Magick.fonts }
|
77
|
-
assert_instance_of(Array, res)
|
78
|
-
res.each do |f|
|
79
|
-
assert_instance_of(Magick::Font, f)
|
80
|
-
assert_instance_of(String, f.name)
|
81
|
-
assert_instance_of(String, f.description) unless f.description.nil?
|
82
|
-
assert_instance_of(String, f.family)
|
83
|
-
assert_instance_of(Magick::StyleType, f.style)
|
84
|
-
assert_instance_of(Magick::StretchType, f.stretch)
|
85
|
-
assert_instance_of(Fixnum, f.weight)
|
86
|
-
assert_instance_of(String, f.encoding) unless f.encoding.nil?
|
87
|
-
assert_instance_of(String, f.foundry) unless f.foundry.nil?
|
88
|
-
assert_instance_of(String, f.format) unless f.format.nil?
|
89
|
-
end
|
90
|
-
Magick.fonts {|f| assert_instance_of(Magick::Font, f) }
|
55
|
+
assert_nothing_raised do
|
56
|
+
ary = Magick::AlignType.enumerators
|
91
57
|
end
|
58
|
+
assert_instance_of(Array, ary)
|
59
|
+
assert_equal(4, ary.length)
|
92
60
|
|
93
|
-
|
94
|
-
|
95
|
-
assert_nothing_raised { res = Magick.formats }
|
96
|
-
assert_instance_of(Hash, res)
|
97
|
-
res.each do |f, v|
|
98
|
-
assert_instance_of(String, f)
|
99
|
-
assert_instance_of(String, v)
|
100
|
-
end
|
101
|
-
Magick.formats.each { |f, v| assert_not_nil(f); assert_not_nil(v) }
|
61
|
+
assert_nothing_raised do
|
62
|
+
ary = Magick::AnchorType.enumerators
|
102
63
|
end
|
64
|
+
assert_instance_of(Array, ary)
|
65
|
+
assert_equal(3, ary.length)
|
66
|
+
end
|
103
67
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
g = Magick::Geometry.new(40)
|
111
|
-
gs = g.to_s
|
112
|
-
assert_equal('40x', gs)
|
113
|
-
|
114
|
-
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
115
|
-
gs2 = g2.to_s
|
116
|
-
assert_equal(gs, gs2)
|
117
|
-
|
118
|
-
g = Magick::Geometry.new(40, 50)
|
119
|
-
gs = g.to_s
|
120
|
-
assert_equal('40x50', gs)
|
121
|
-
|
122
|
-
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
123
|
-
gs2 = g2.to_s
|
124
|
-
assert_equal(gs, gs2)
|
125
|
-
|
126
|
-
g = Magick::Geometry.new(40, 50, 10)
|
127
|
-
gs = g.to_s
|
128
|
-
assert_equal('40x50+10+0', gs)
|
129
|
-
|
130
|
-
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
131
|
-
gs2 = g2.to_s
|
132
|
-
assert_equal(gs, gs2)
|
133
|
-
|
134
|
-
g = Magick::Geometry.new(40, 50, 10, -15)
|
135
|
-
gs = g.to_s
|
136
|
-
assert_equal('40x50+10-15', gs)
|
137
|
-
|
138
|
-
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
139
|
-
gs2 = g2.to_s
|
140
|
-
assert_equal(gs, gs2)
|
141
|
-
|
142
|
-
g = Magick::Geometry.new(40, 50, 0, 0, Magick::AreaGeometry)
|
143
|
-
gs = g.to_s
|
144
|
-
assert_equal('40x50@', gs)
|
68
|
+
def test_features
|
69
|
+
res = nil
|
70
|
+
assert_nothing_raised { res = Magick::Magick_features }
|
71
|
+
assert_instance_of(String, res)
|
72
|
+
end
|
145
73
|
|
146
|
-
|
147
|
-
|
148
|
-
|
74
|
+
def test_fonts
|
75
|
+
res = nil
|
76
|
+
assert_nothing_raised { res = Magick.fonts }
|
77
|
+
assert_instance_of(Array, res)
|
78
|
+
res.each do |f|
|
79
|
+
assert_instance_of(Magick::Font, f)
|
80
|
+
assert_instance_of(String, f.name)
|
81
|
+
assert_instance_of(String, f.description) unless f.description.nil?
|
82
|
+
assert_instance_of(String, f.family)
|
83
|
+
assert_instance_of(Magick::StyleType, f.style)
|
84
|
+
assert_instance_of(Magick::StretchType, f.stretch)
|
85
|
+
assert_instance_of(Fixnum, f.weight)
|
86
|
+
assert_instance_of(String, f.encoding) unless f.encoding.nil?
|
87
|
+
assert_instance_of(String, f.foundry) unless f.foundry.nil?
|
88
|
+
assert_instance_of(String, f.format) unless f.format.nil?
|
89
|
+
end
|
90
|
+
Magick.fonts {|f| assert_instance_of(Magick::Font, f) }
|
91
|
+
end
|
149
92
|
|
150
|
-
|
151
|
-
|
152
|
-
|
93
|
+
def test_formats
|
94
|
+
res = nil
|
95
|
+
assert_nothing_raised { res = Magick.formats }
|
96
|
+
assert_instance_of(Hash, res)
|
97
|
+
res.each do |f, v|
|
98
|
+
assert_instance_of(String, f)
|
99
|
+
assert_instance_of(String, v)
|
100
|
+
end
|
101
|
+
Magick.formats.each { |f, v| assert_not_nil(f); assert_not_nil(v) }
|
102
|
+
end
|
153
103
|
|
154
|
-
|
155
|
-
|
156
|
-
|
104
|
+
def test_geometry
|
105
|
+
g = nil
|
106
|
+
gs = nil
|
107
|
+
g2 = nil
|
108
|
+
gs2 = nil
|
109
|
+
assert_nothing_raised { g = Magick::Geometry.new }
|
110
|
+
assert_nothing_raised { gs = g.to_s }
|
111
|
+
assert_equal('', gs)
|
157
112
|
|
158
|
-
|
159
|
-
|
160
|
-
|
113
|
+
g = Magick::Geometry.new(40)
|
114
|
+
gs = g.to_s
|
115
|
+
assert_equal('40x', gs)
|
161
116
|
|
162
|
-
|
163
|
-
|
164
|
-
|
117
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
118
|
+
gs2 = g2.to_s
|
119
|
+
assert_equal(gs, gs2)
|
165
120
|
|
166
|
-
|
167
|
-
|
168
|
-
|
121
|
+
g = Magick::Geometry.new(40, 50)
|
122
|
+
gs = g.to_s
|
123
|
+
assert_equal('40x50', gs)
|
169
124
|
|
170
|
-
|
171
|
-
|
172
|
-
|
125
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
126
|
+
gs2 = g2.to_s
|
127
|
+
assert_equal(gs, gs2)
|
173
128
|
|
174
|
-
|
175
|
-
|
176
|
-
|
129
|
+
g = Magick::Geometry.new(40, 50, 10)
|
130
|
+
gs = g.to_s
|
131
|
+
assert_equal('40x50+10+0', gs)
|
177
132
|
|
178
|
-
|
179
|
-
|
180
|
-
|
133
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
134
|
+
gs2 = g2.to_s
|
135
|
+
assert_equal(gs, gs2)
|
181
136
|
|
182
|
-
|
183
|
-
|
184
|
-
|
137
|
+
g = Magick::Geometry.new(40, 50, 10, -15)
|
138
|
+
gs = g.to_s
|
139
|
+
assert_equal('40x50+10-15', gs)
|
185
140
|
|
186
|
-
|
187
|
-
|
188
|
-
|
141
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
142
|
+
gs2 = g2.to_s
|
143
|
+
assert_equal(gs, gs2)
|
189
144
|
|
190
|
-
|
191
|
-
|
192
|
-
|
145
|
+
g = Magick::Geometry.new(40, 50, 0, 0, Magick::AreaGeometry)
|
146
|
+
gs = g.to_s
|
147
|
+
assert_equal('40x50@', gs)
|
193
148
|
|
194
|
-
|
195
|
-
|
196
|
-
|
149
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
150
|
+
gs2 = g2.to_s
|
151
|
+
assert_equal(gs, gs2)
|
197
152
|
|
198
|
-
|
199
|
-
|
200
|
-
|
153
|
+
g = Magick::Geometry.new(40, 50, 0, 0, Magick::AspectGeometry)
|
154
|
+
gs = g.to_s
|
155
|
+
assert_equal('40x50!', gs)
|
156
|
+
|
157
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
158
|
+
gs2 = g2.to_s
|
159
|
+
assert_equal(gs, gs2)
|
160
|
+
|
161
|
+
g = Magick::Geometry.new(40, 50, 0, 0, Magick::LessGeometry)
|
162
|
+
gs = g.to_s
|
163
|
+
assert_equal('40x50<', gs)
|
164
|
+
|
165
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
166
|
+
gs2 = g2.to_s
|
167
|
+
assert_equal(gs, gs2)
|
168
|
+
|
169
|
+
g = Magick::Geometry.new(40, 50, 0, 0, Magick::GreaterGeometry)
|
170
|
+
gs = g.to_s
|
171
|
+
assert_equal('40x50>', gs)
|
172
|
+
|
173
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
174
|
+
gs2 = g2.to_s
|
175
|
+
assert_equal(gs, gs2)
|
176
|
+
|
177
|
+
g = Magick::Geometry.new(40, 50, 0, 0, Magick::MinimumGeometry)
|
178
|
+
gs = g.to_s
|
179
|
+
assert_equal('40x50^', gs)
|
180
|
+
|
181
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
182
|
+
gs2 = g2.to_s
|
183
|
+
assert_equal(gs, gs2)
|
184
|
+
|
185
|
+
g = Magick::Geometry.new(40, 0, 0, 0, Magick::PercentGeometry)
|
186
|
+
gs = g.to_s
|
187
|
+
assert_equal('40%', gs)
|
188
|
+
|
189
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
190
|
+
gs2 = g2.to_s
|
191
|
+
assert_equal(gs, gs2)
|
192
|
+
|
193
|
+
g = Magick::Geometry.new(40, 60, 0, 0, Magick::PercentGeometry)
|
194
|
+
gs = g.to_s
|
195
|
+
assert_equal('40%x60%', gs)
|
196
|
+
|
197
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
198
|
+
gs2 = g2.to_s
|
199
|
+
assert_equal(gs, gs2)
|
200
|
+
|
201
|
+
g = Magick::Geometry.new(40, 60, 10, 0, Magick::PercentGeometry)
|
202
|
+
gs = g.to_s
|
203
|
+
assert_equal('40%x60%+10+0', gs)
|
204
|
+
|
205
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
206
|
+
gs2 = g2.to_s
|
207
|
+
assert_equal(gs, gs2)
|
208
|
+
|
209
|
+
g = Magick::Geometry.new(40, 60, 10, 20, Magick::PercentGeometry)
|
210
|
+
gs = g.to_s
|
211
|
+
assert_equal('40%x60%+10+20', gs)
|
201
212
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
g = Magick::Geometry.new(40, 60, 10, 20, Magick::PercentGeometry)
|
207
|
-
gs = g.to_s
|
208
|
-
assert_equal('40%x60%+10+20', gs)
|
213
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
214
|
+
gs2 = g2.to_s
|
215
|
+
assert_equal(gs, gs2)
|
209
216
|
|
210
|
-
|
211
|
-
|
212
|
-
|
217
|
+
g = Magick::Geometry.new(40.5, 60.75)
|
218
|
+
gs = g.to_s
|
219
|
+
assert_equal('40.50x60.75', gs)
|
213
220
|
|
214
|
-
|
215
|
-
|
216
|
-
|
221
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
222
|
+
gs2 = g2.to_s
|
223
|
+
assert_equal(gs, gs2)
|
217
224
|
|
218
|
-
|
219
|
-
|
220
|
-
|
225
|
+
g = Magick::Geometry.new(40.5, 60.75, 0, 0, Magick::PercentGeometry)
|
226
|
+
gs = g.to_s
|
227
|
+
assert_equal('40.50%x60.75%', gs)
|
221
228
|
|
222
|
-
|
223
|
-
|
224
|
-
|
229
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
230
|
+
gs2 = g2.to_s
|
231
|
+
assert_equal(gs, gs2)
|
225
232
|
|
226
|
-
|
227
|
-
|
228
|
-
|
233
|
+
g = Magick::Geometry.new(0, 0, 10, 20)
|
234
|
+
gs = g.to_s
|
235
|
+
assert_equal('+10+20', gs)
|
229
236
|
|
230
|
-
|
231
|
-
|
232
|
-
|
237
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
238
|
+
gs2 = g2.to_s
|
239
|
+
assert_equal(gs, gs2)
|
233
240
|
|
234
|
-
|
235
|
-
|
236
|
-
|
241
|
+
g = Magick::Geometry.new(0, 0, 10)
|
242
|
+
gs = g.to_s
|
243
|
+
assert_equal('+10+0', gs)
|
237
244
|
|
238
|
-
|
239
|
-
|
240
|
-
|
245
|
+
assert_nothing_raised { g2 = Magick::Geometry.from_s(gs) }
|
246
|
+
gs2 = g2.to_s
|
247
|
+
assert_equal(gs, gs2)
|
241
248
|
|
242
|
-
|
243
|
-
|
244
|
-
|
249
|
+
# assert behavior with empty string argument
|
250
|
+
assert_nothing_raised { g = Magick::Geometry.from_s('') }
|
251
|
+
assert_equal('', g.to_s)
|
245
252
|
|
246
|
-
|
247
|
-
|
248
|
-
|
253
|
+
assert_raise(ArgumentError) { Magick::Geometry.new(Magick::AreaGeometry) }
|
254
|
+
assert_raise(ArgumentError) { Magick::Geometry.new(40, Magick::AreaGeometry) }
|
255
|
+
assert_raise(ArgumentError) { Magick::Geometry.new(40, 20, Magick::AreaGeometry) }
|
256
|
+
assert_raise(ArgumentError) { Magick::Geometry.new(40, 20, 10, Magick::AreaGeometry) }
|
257
|
+
end
|
249
258
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
assert_raise(ArgumentError) { Magick::Geometry.new(40, 20, 10, Magick::AreaGeometry) }
|
254
|
-
end
|
259
|
+
def test_set_log_event_mask
|
260
|
+
assert_nothing_raised { Magick.set_log_event_mask('Module,Coder') }
|
261
|
+
end
|
255
262
|
|
256
|
-
|
257
|
-
|
258
|
-
|
263
|
+
def test_set_log_format
|
264
|
+
assert_nothing_raised { Magick.set_log_format('format %d%e%f') }
|
265
|
+
end
|
259
266
|
|
260
|
-
|
261
|
-
|
262
|
-
|
267
|
+
def test_limit_resources
|
268
|
+
cur = new = nil
|
269
|
+
|
270
|
+
assert_nothing_raised {cur = Magick.limit_resource(:memory, 500)}
|
271
|
+
assert_kind_of(Integer, cur)
|
272
|
+
assert(cur > 1024 ** 2)
|
273
|
+
assert_nothing_raised {new = Magick.limit_resource('memory')}
|
274
|
+
assert_equal(500, new)
|
275
|
+
Magick.limit_resource(:memory, cur)
|
276
|
+
|
277
|
+
assert_nothing_raised {cur = Magick.limit_resource(:map, 3500)}
|
278
|
+
assert_kind_of(Integer, cur)
|
279
|
+
assert(cur > 1024 ** 2)
|
280
|
+
assert_nothing_raised {new = Magick.limit_resource('map')}
|
281
|
+
assert_equal(3500, new)
|
282
|
+
Magick.limit_resource(:map, cur)
|
283
|
+
|
284
|
+
assert_nothing_raised {cur = Magick.limit_resource(:disk, 3*1024*1024*1024)}
|
285
|
+
assert_kind_of(Integer, cur)
|
286
|
+
assert(cur > 1024 ** 2)
|
287
|
+
assert_nothing_raised {new = Magick.limit_resource('disk')}
|
288
|
+
assert_equal(3221225472, new)
|
289
|
+
Magick.limit_resource(:disk, cur)
|
290
|
+
|
291
|
+
assert_nothing_raised {cur = Magick.limit_resource(:file, 500)}
|
292
|
+
assert_kind_of(Integer, cur)
|
293
|
+
assert(cur > 512)
|
294
|
+
assert_nothing_raised {new = Magick.limit_resource('file')}
|
295
|
+
assert_equal(500, new)
|
296
|
+
Magick.limit_resource(:file, cur)
|
297
|
+
|
298
|
+
assert_raise(ArgumentError) { Magick.limit_resource(:xxx) }
|
299
|
+
assert_raise(ArgumentError) { Magick.limit_resource('xxx') }
|
300
|
+
assert_raise(ArgumentError) { Magick.limit_resource('map', 3500, 2) }
|
301
|
+
assert_raise(ArgumentError) { Magick.limit_resource }
|
302
|
+
end
|
263
303
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
assert_nothing_raised {new = Magick.limit_resource('memory')}
|
271
|
-
assert_equal(500, new)
|
272
|
-
Magick.limit_resource(:memory, cur)
|
273
|
-
|
274
|
-
assert_nothing_raised {cur = Magick.limit_resource(:map, 3500)}
|
275
|
-
assert_kind_of(Integer, cur)
|
276
|
-
assert(cur > 1024 ** 2)
|
277
|
-
assert_nothing_raised {new = Magick.limit_resource('map')}
|
278
|
-
assert_equal(3500, new)
|
279
|
-
Magick.limit_resource(:map, cur)
|
280
|
-
|
281
|
-
assert_nothing_raised {cur = Magick.limit_resource(:disk, 3*1024*1024*1024)}
|
282
|
-
assert_kind_of(Integer, cur)
|
283
|
-
assert(cur > 1024 ** 2)
|
284
|
-
assert_nothing_raised {new = Magick.limit_resource('disk')}
|
285
|
-
assert_equal(3221225472, new)
|
286
|
-
Magick.limit_resource(:disk, cur)
|
287
|
-
|
288
|
-
assert_nothing_raised {cur = Magick.limit_resource(:file, 500)}
|
289
|
-
assert_kind_of(Integer, cur)
|
290
|
-
assert(cur > 512)
|
291
|
-
assert_nothing_raised {new = Magick.limit_resource('file')}
|
292
|
-
assert_equal(500, new)
|
293
|
-
Magick.limit_resource(:file, cur)
|
294
|
-
|
295
|
-
assert_raise(ArgumentError) { Magick.limit_resource(:xxx) }
|
296
|
-
assert_raise(ArgumentError) { Magick.limit_resource('xxx') }
|
297
|
-
assert_raise(ArgumentError) { Magick.limit_resource('map', 3500, 2) }
|
298
|
-
assert_raise(ArgumentError) { Magick.limit_resource }
|
304
|
+
def test_trace_proc
|
305
|
+
Magick.trace_proc = proc do |which, description, id, method|
|
306
|
+
assert(which == :c)
|
307
|
+
assert_instance_of(String, description)
|
308
|
+
assert_instance_of(String, id)
|
309
|
+
assert_equal(:initialize, method)
|
299
310
|
end
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
assert_instance_of(String, description)
|
305
|
-
assert_instance_of(String, id)
|
306
|
-
assert_equal(:initialize, method)
|
307
|
-
end
|
308
|
-
begin
|
309
|
-
img = Magick::Image.new(20,20)
|
310
|
-
ensure
|
311
|
-
Magick.trace_proc = nil
|
312
|
-
end
|
311
|
+
begin
|
312
|
+
img = Magick::Image.new(20,20)
|
313
|
+
ensure
|
314
|
+
Magick.trace_proc = nil
|
313
315
|
end
|
316
|
+
end
|
314
317
|
end
|
315
318
|
|
316
319
|
if __FILE__ == $PROGRAM_NAME
|