Ignore:
Timestamp:
Sep 27, 2008, 4:11:36 PM (12 years ago)
Author:
Sam Hocevar
Message:

Continuing the libcucul-libcaca merge.

Location:
libcaca/trunk/ruby/t
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/ruby/t/tc_canvas.rb

    r2004 r2822  
    11require 'test/unit'
    2 require 'cucul'
     2require 'caca'
    33
    44class TC_Canvas < Test::Unit::TestCase
    55    def setup
    6         @c = Cucul::Canvas.new(3, 3)
     6        @c = Caca::Canvas.new(3, 3)
    77    end
    88    def test_create
    9         c = Cucul::Canvas.new(3, 3)
     9        c = Caca::Canvas.new(3, 3)
    1010        assert_not_nil(c, 'Canvas creation failed')
    1111        assert(c.width == 3 && c.height == 3, 'Wrong size for new canvas')
     
    4646    end
    4747    def test_render
    48         c = Cucul::Canvas.new(4,4)
     48        c = Caca::Canvas.new(4,4)
    4949        c.put_str(0,0,"plop")
    50         f = Cucul::Font.new(Cucul::Font.list[0])
     50        f = Caca::Font.new(Caca::Font.list[0])
    5151        assert_not_nil(c.render(f, c.width*f.width, c.height*f.height, c.width*f.width*4))
    5252    end
    5353    def test_fail_render
    54         c = Cucul::Canvas.new(4,4)
     54        c = Caca::Canvas.new(4,4)
    5555        assert_raise(ArgumentError) {
    5656            c.render(nil, c.width, c.height, c.width*4)
  • libcaca/trunk/ruby/t/tc_display.rb

    r2298 r2822  
    1515        driver = Caca::Display.driver_list[0]
    1616        assert_raise(ArgumentError){Caca::Display.new(driver, driver)}
    17         c = Cucul::Canvas.new(3, 3)
     17        c = Caca::Canvas.new(3, 3)
    1818        assert_raise(ArgumentError){Caca::Display.new(c, c)}
    1919    end
    2020    def test_create_from_canvas
    21         c = Cucul::Canvas.new(3, 3)
     21        c = Caca::Canvas.new(3, 3)
    2222        d = Caca::Display.new(c)
    2323        assert_not_nil(d, 'Display creation failed')
     
    2525    end
    2626    def test_set_title
    27         c = Cucul::Canvas.new(3, 3)
     27        c = Caca::Canvas.new(3, 3)
    2828        d = Caca::Display.new(c)
    2929        d.title = "Test !"
  • libcaca/trunk/ruby/t/tc_dither.rb

    r2008 r2822  
    11require 'test/unit'
    2 require 'cucul'
     2require 'caca'
    33
    44class TC_Canvas < Test::Unit::TestCase
    55    def test_create
    66        assert_nothing_raised {
    7             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     7            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    88        }
    99    end
    1010    def test_fail_create
    1111        assert_raise(RuntimeError) {
    12             d = Cucul::Dither.new(-1, 32, 32, 32, 0, 0, 0, 0)
     12            d = Caca::Dither.new(-1, 32, 32, 32, 0, 0, 0, 0)
    1313        }
    1414    end
    1515    def test_set_palette
    1616        assert_nothing_raised {
    17             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     17            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    1818            d.palette=[[0xfff, 0xfff, 0xfff, 0xfff]]*256
    1919        }
     
    2121    def test_fail_set_palette
    2222        assert_raise(ArgumentError) {
    23             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     23            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    2424            d.palette=[]
    2525        }
     
    2727    def test_fail_set_palette2
    2828        assert_raise(RuntimeError) {
    29             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     29            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    3030            d.palette=[[0xffff, 0, 0, 0]]*256
    3131        }
     
    3333    def test_set_brightness
    3434        assert_nothing_raised {
    35             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     35            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    3636            d.brightness=0.5
    3737        }
     
    3939    def test_set_gamma
    4040        assert_nothing_raised {
    41             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     41            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    4242            d.gamma=0.5
    4343        }
     
    4545    def test_set_contrast
    4646        assert_nothing_raised {
    47             d = Cucul::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
     47            d = Caca::Dither.new(8, 32, 32, 32, 0, 0, 0, 0)
    4848            d.contrast=0.5
    4949        }
  • libcaca/trunk/ruby/t/tc_font.rb

    r1995 r2822  
    11require 'test/unit'
    2 require 'cucul'
     2require 'caca'
    33
    44class TC_Canvas < Test::Unit::TestCase
    55    def test_list
    6         assert_not_nil(Cucul::Font.list)
     6        assert_not_nil(Caca::Font.list)
    77    end
    88    def test_load
    9         Cucul::Font.list.each{|f|
    10                 font = Cucul::Font.new(f)
     9        Caca::Font.list.each{|f|
     10                font = Caca::Font.new(f)
    1111                assert_not_nil(font)
    1212                assert_not_nil(font.width)
     
    1717    def test_fail_load
    1818        assert_raise(RuntimeError) {
    19                 Cucul::Font.new("This font should not exist")
     19                Caca::Font.new("This font should not exist")
    2020        }
    2121    end
  • libcaca/trunk/ruby/t/tc_frame.rb

    r1949 r2822  
    11require 'test/unit'
    2 require 'cucul'
     2require 'caca'
    33
    44class TC_Frame < Test::Unit::TestCase
    55        def setup
    6                 @c = Cucul::Canvas.new(3, 3)
     6                @c = Caca::Canvas.new(3, 3)
    77        end
    88        def test_create
Note: See TracChangeset for help on using the changeset viewer.