Sha256: 2e9b9abf96ebcd81386ec3026fe91c1db3079d0e5f147bb0ced1a2dd515ecec6
Contents?: true
Size: 1.8 KB
Versions: 44
Compression:
Stored size: 1.8 KB
Contents
require 'test/unit' require 'mxx_ru/binary_library' class TC_BinaryLibrary < Test::Unit::TestCase def test_creation static = Mxx_ru::BinaryLibrary.new( 'static', Mxx_ru::BinaryLibrary::STATIC ) assert_equal( 'static', static.name ) assert_equal( Mxx_ru::BinaryLibrary::STATIC, static.type ) shared = Mxx_ru::BinaryLibrary.new( 'shared', Mxx_ru::BinaryLibrary::SHARED ) assert_equal( 'shared', shared.name ) assert_equal( Mxx_ru::BinaryLibrary::SHARED, shared.type ) any = Mxx_ru::BinaryLibrary.new( 'any', Mxx_ru::BinaryLibrary::ANY ) assert_equal( 'any', any.name ) assert_equal( Mxx_ru::BinaryLibrary::ANY, any.type ) end def test_incorrect_type assert_nothing_raised { b = Mxx_ru::BinaryLibrary.new( 'a', Mxx_ru::BinaryLibrary::STATIC ) } assert_raise( Mxx_ru::InvalidValueEx ) { b = Mxx_ru::BinaryLibrary.new( 'b', :dynamic ) } end def test_array_of_lib_equality a = [ Mxx_ru::BinaryLibrary.new( 'A', Mxx_ru::BinaryLibrary::STATIC ), Mxx_ru::BinaryLibrary.new( 'B', Mxx_ru::BinaryLibrary::SHARED ), Mxx_ru::BinaryLibrary.new( 'C', Mxx_ru::BinaryLibrary::ANY ) ] b = [ Mxx_ru::BinaryLibrary.new( 'A', Mxx_ru::BinaryLibrary::STATIC ), Mxx_ru::BinaryLibrary.new( 'B', Mxx_ru::BinaryLibrary::SHARED ), Mxx_ru::BinaryLibrary.new( 'C', Mxx_ru::BinaryLibrary::ANY ) ] assert_equal( a, b ) end def test_array_of_lib_uniq a = [ Mxx_ru::BinaryLibrary.new( 'A', Mxx_ru::BinaryLibrary::STATIC ), Mxx_ru::BinaryLibrary.new( 'B', Mxx_ru::BinaryLibrary::SHARED ), Mxx_ru::BinaryLibrary.new( 'C', Mxx_ru::BinaryLibrary::ANY ) ] b = a.uniq assert_equal( a, b ) end end
Version data entries
44 entries across 44 versions & 1 rubygems