File: test-clutter-brightness-contrast-effect.rb

package info (click to toggle)
ruby-gnome 4.3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,320 kB
  • sloc: ruby: 55,206; ansic: 29,012; xml: 333; sh: 229; cpp: 45; makefile: 42
file content (56 lines) | stat: -rw-r--r-- 1,894 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright (C) 2014  Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

class ClutterBrightnessContrastEffectTest < Test::Unit::TestCase
  include ClutterTestUtils

  def setup
    @effect = Clutter::BrightnessContrastEffect.new
  end

  def test_brightness
    brightness = 127
    @effect.brightness = brightness
    assert_equal([brightness, brightness, brightness],
                 @effect.brightness)
  end

  def test_brightness_rgb_params
    brightness_red = 120
    brightness_green = 200
    brightness_blue = 250
    @effect.set_brightness(brightness_red, brightness_green,
                           brightness_blue)
    assert_equal([brightness_red, brightness_green, brightness_blue],
                 @effect.brightness)
  end

  def test_contrast
    contrast = 127
    @effect.contrast = contrast
    assert_equal([contrast, contrast, contrast],
                 @effect.contrast)
  end

  def test_contrast_rgb_params
    contrast_red = 250
    contrast_green = 120
    contrast_blue = 100
    @effect.set_contrast(contrast_red, contrast_green, contrast_blue)
    assert_equal([contrast_red, contrast_green, contrast_blue],
                 @effect.contrast)
  end
end