Project

General

Profile

Backport #7295 ยป 0001-backport-bug-6814.diff

luislavena (Luis Lavena), 11/07/2012 05:11 AM

View differences:

ChangeLog
1
Mon Aug  6 19:15:11 2012  Masaki Suketa <masaki.suketa@nifty.ne.jp>
2

  
3
	* test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
4
	  to pass some assertion.  Thanks to Hiroshi Shirosaki.
5
	  [ruby-core:46873][Bug #6814]
6

  
1 7
Fri Oct 26 17:22:18 2012  NAKAMURA Usaku  <usa@ruby-lang.org>
2 8

  
3 9
	* file.c (append_fspath): need to set the encoding to result always.
test/win32ole/test_win32ole_variant.rb
12 12
if defined?(WIN32OLE_VARIANT)
13 13

  
14 14
  class TestWIN32OLE_VARIANT < Test::Unit::TestCase
15
    def setup
16
      @orglocale = WIN32OLE.locale
17
      WIN32OLE.locale = 0x0409 # set locale  US-Eng
18
    end
19

  
20
    def teardown
21
      WIN32OLE.locale = @orglocale
22
    end
15 23

  
16 24
    def test_s_new
17 25
      obj = WIN32OLE_VARIANT.new('foo')
......
395 403

  
396 404
    def test_conversion_str2cy
397 405
      begin
398
        begin
399
          WIN32OLE.locale = 0x0411 # set locale Japanese
400
        rescue WIN32OLERuntimeError
401
          STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_conversion_str2cy is skipped(Japanese locale is not installed)")
402
        end
403
        if WIN32OLE.locale == 0x0411
404
          obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
405
          assert_equal("10000", obj.value)
406
        end
407
      ensure
408
        WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
406
        WIN32OLE.locale = 0x0411 # set locale Japanese
407
      rescue WIN32OLERuntimeError
408
        skip("Japanese locale is not installed")
409
      end
410
      if WIN32OLE.locale == 0x0411
411
        obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
412
        assert_equal("10000", obj.value)
409 413
      end
410 414
    end
411 415