| Class | RS::Test::RSTestImageProperties |
| In: |
rsil/test/rstestimageproperties.rb
|
| Parent: | Test::Unit::TestCase |
| Class: | RSTestImageProperties |
| File: | rstestimageproperties.rb |
| Purpose: | RSTestImageProperties includes methods to test class RS::Utils::RSImageProperties. |
| Created by: | Mario Pehle, 2006/05/02 |
| Required modules: | Test::Unit |
| Offers functions: | - |
| Description: | Sets up test object. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#new |
| Returns: | RSImageProperties |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 44
44: def setup
45: @rsproperties = RS::Utils::RSImageProperties.new
46: end
| Description: | Deletes test object and calls garbage collector. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | GC#start |
| Returns: | nil |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 60
60: def teardown
61: @rsproperties = nil
62: GC.start
63: end
| Description: | Tests RS::Utils::RSImageProperties#compressionfactor for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#compressionfactor |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 178
178: def test_compressionfactor
179: assert_raise(ArgumentError) { @rsproperties.compressionfactor = '2.0' }
180: assert_nothing_raised { @rsproperties.compressionfactor = 1.0 }
181: assert_equal(
182: 1.0,
183: @rsproperties.compressionfactor,
184: 'Possible wrong convertion.'
185: )
186: end
| Description: | Tests RS::Utils::RSImageProperties#compressionmethod for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#compressionmethod |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 200
200: def test_compressionmethod
201: assert_nothing_raised do
202: RS::Utils::RSImageProperties::TIFF_CONSTANTS.each do |c|
203: @rsproperties.compressionmethod = c
204: end
205: end
206: assert_equal(
207: RS::Utils::RSImageProperties::TIFF_CONSTANTS.last,
208: @rsproperties.compressionmethod,
209: 'Possible wrong convertion.'
210: )
211: end
| Description: | Tests RS::Utils::RSImageProperties#currentframe for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#currentframe |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 225
225: def test_currentframe
226: assert_nothing_raised { @rsproperties.currentframe = 'prop' }
227: assert_nothing_raised { @rsproperties.currentframe = 1 }
228: assert_equal(1, @rsproperties.currentframe, 'Possible wrong convertion.')
229: end
| Description: | Tests RS::Utils::RSImageProperties#currentframeduration for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#currentframeduration |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 243
243: def test_currentframeduration
244: assert_raise(ArgumentError) do
245: @rsproperties.currentframeduration = '-1.0'
246: end
247: assert_nothing_raised { @rsproperties.gamma = 1.0 }
248: assert_equal(1.0, @rsproperties.gamma, 'Possible wrong convertion.')
249: end
| Description: | Tests RS::Utils::RSImageProperties#dithertransparency for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#dithertransparency |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 263
263: def test_dithertransparency
264: assert(
265: @rsproperties.dithertransparency,
266: 'Possbile wrong convertion or initialization.'
267: )
268: assert_nothing_raised { @rsproperties.dithertransparency = false }
269: assert(
270: !@rsproperties.dithertransparency,
271: 'Possbile wrong convertion or initialization.'
272: )
273: assert_raise(ArgumentError) { @rsproperties.dithertransparency = 'prop' }
274: end
| Description: | Tests RS::Utils::RSImageProperties#framecount for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#framecount |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 288
288: def test_framecount
289: assert_nothing_raised { @rsproperties.framecount = 'prop' }
290: assert_nothing_raised { @rsproperties.framecount = 1 }
291: assert_equal(
292: 1,
293: @rsproperties.framecount,
294: 'Possible wrong convertion.'
295: )
296: end
| Description: | Tests RS::Utils::RSImageProperties#from_rsproperties for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#from_rsproperties |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 113
113: def test_from_rsproperties
114: prop = nil
115: assert_nothing_raised { prop = RS::Utils::RSImageProperties.new }
116: assert_not_same(
117: @rsproperties.objc_object,
118: prop.objc_object,
119: 'Same basic objects.'
120: )
121: assert_raise(ArgumentError) do
122: @rsproperties.from_rsproperties 'not rsprop'
123: end
124: assert_nothing_raised { @rsproperties.from_rsproperties(prop) }
125: end
| Description: | Tests RS::Utils::RSImageProperties#gamma for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#gamma |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 310
310: def test_gamma
311: assert_raise(ArgumentError) { @rsproperties.gamma = '2.0' }
312: assert_nothing_raised { @rsproperties.gamma = 1.0 }
313: assert_equal(1.0, @rsproperties.gamma, 'Possible wrong convertion.')
314: end
| Description: | Tests RS::Utils::RSImageProperties#get for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#get |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 160
160: def test_get
161: assert_raise(StandardError) { @rsproperties.get 'key' }
162: assert_nothing_raised { @rsproperties.set 'key', 'value' }
163: assert_nothing_raised { @rsproperties.get 'key' }
164: end
| Description: | Tests RS::Utils::RSImageProperties#new for correct initialization. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#new |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 77
77: def test_initialize
78: assert_not_nil(
79: RS::Utils::RSImageProperties.new,
80: 'Parameterless initialization not failed.'
81: )
82: assert_raise(ArgumentError) { RS::Utils::RSImageProperties.new '-1' }
83: assert_raise(ArgumentError) { RS::Utils::RSImageProperties.new 'arg' }
84: prop = nil
85: assert_nothing_raised do
86: prop = RS::Utils::RSImageProperties.new('key'=>'value')
87: end
88: assert_not_nil(prop.get('key'))
89: assert_equal(
90: 'value',
91: prop.get('key'),
92: 'No equal value after reading from Hash.'
93: )
94: assert_kind_of(
95: OSX::OCObject,
96: RS::Utils::RSImageProperties.new.objc_object,
97: 'No objc object initialized.'
98: )
99: end
| Description: | Tests RS::Utils::RSImageProperties#interlaced for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#interlaced |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 328
328: def test_interlaced
329: assert(
330: @rsproperties.interlaced,
331: 'Possbile wrong convertion or initialization.'
332: )
333: assert_nothing_raised { @rsproperties.interlaced = false }
334: assert(
335: !@rsproperties.interlaced,
336: 'Possbile wrong convertion or initialization.'
337: )
338: assert_raise(ArgumentError) { @rsproperties.interlaced = 'prop' }
339: end
| Description: | Tests RS::Utils::RSImageProperties#loopcount for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#loopcount |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 353
353: def test_loopcount
354: assert_nothing_raised { @rsproperties.loopcount = 'prop' }
355: assert_nothing_raised { @rsproperties.loopcount = 1 }
356: assert_equal(1, @rsproperties.loopcount, 'Possible wrong convertion.')
357: assert_raise(ArgumentError) { @rsproperties.loopcount = -1 }
358: end
| Description: | Tests RS::Utils::RSImageProperties#objc_object for correct return value. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#objc_object |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 397
397: def test_objc_object
398: assert_nothing_raised { @rsproperties.objc_object }
399: assert_not_nil(
400: @rsproperties.objc_object,
401: 'Basic objc object not initialized.'
402: )
403: end
| Description: | Tests RS::Utils::RSImageProperties#progressive for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#progressive |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 372
372: def test_progressive
373: assert(
374: @rsproperties.progressive,
375: 'Possbile wrong convertion or initialization.'
376: )
377: assert_nothing_raised { @rsproperties.progressive = false }
378: assert(
379: !@rsproperties.progressive,
380: 'Possbile wrong convertion or initialization.'
381: )
382: assert_raise(ArgumentError) { @rsproperties.progressive = 'prop' }
383: end
| Description: | Tests RS::Utils::RSImageProperties#set for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSImageProperties#set |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestimageproperties.rb, line 139
139: def test_set
140: assert_nothing_raised { @rsproperties.set 'key', 'value' }
141: assert_equal(
142: @rsproperties.get('key'),
143: 'value',
144: 'Change in type or value.'
145: )
146: end