Project

General

Profile

Bug #3923 » test_errno_message.rb

CP932用テストプログラム - arton (Akio Tajima), 10/10/2010 01:31 AM

 
# coding: cp932
require 'test/unit'

if RUBY_PLATFORM =~ /mswin/ && Encoding.locale_charmap == 'CP932'
class TestErrnoMessage < Test::Unit::TestCase
E = [
Errno::EWOULDBLOCK,
Errno::EINPROGRESS,
Errno::EALREADY,
Errno::ENOTSOCK,
Errno::EDESTADDRREQ,
Errno::EMSGSIZE,
Errno::EPROTOTYPE,
Errno::ENOPROTOOPT,
Errno::EPROTONOSUPPORT,
Errno::ESOCKTNOSUPPORT,
Errno::EOPNOTSUPP,
Errno::EPFNOSUPPORT,
Errno::EAFNOSUPPORT,
Errno::EADDRINUSE,
Errno::EADDRNOTAVAIL,
Errno::ENETDOWN,
Errno::ENETUNREACH,
Errno::ENETRESET,
Errno::ECONNABORTED,
Errno::ECONNRESET,
Errno::ENOBUFS,
Errno::EISCONN,
Errno::ENOTCONN,
Errno::ESHUTDOWN,
Errno::ETOOMANYREFS,
Errno::ETIMEDOUT,
Errno::ECONNREFUSED,
Errno::ELOOP,
Errno::ENAMETOOLONG,
Errno::EHOSTDOWN,
Errno::EHOSTUNREACH,
Errno::EPROCLIM,
Errno::EUSERS,
Errno::EDQUOT,
Errno::ESTALE,
Errno::EREMOTE,
]
M = [
'?u???b?N?s?‚̃\?P?b?g??????????Ɋ????ł??܂???ł????B',
'?u???b?N????????s???ł??B',
'???ɑ??삪?i?s???̃u???b?N?s?‚̃\?P?b?g?ɑ΂??āA????????s???悤?Ƃ??܂????B',
'?\?P?b?g?ȊO?̂??̂ɑ΂??đ???????s???悤?Ƃ??܂????B',
'?\?P?b?g?̑??삩??K?v?ȃA?h???X???ȗ????܂????B',
'?f?[?^?O???? ?\?P?b?g?ő??M???ꂽ???b?Z?[?W???A?????̃??b?Z?[?W?̃o?b?t?@?[?܂??͂ق??̃l?b?g???[?N?̐????𒴂??Ă??܂??B?܂??́A?f?[?^?O?????̎?M?Ɏg????o?b?t?@?[???f?[?^?O??????菬?????ݒ肳??Ă??܂??B',
'?\?P?b?g?̊֐??Ăяo???Ńv???g?R?????w?肳??܂??????A?v???????\?P?b?g?̎?ނ̌`?????T?|?[?g???Ă??܂???B',
'getsockopt ?܂??? setsockopt ?̌Ăяo???Ŏw?肳?ꂽ?I?v?V?????܂??̓??x???́A?s?????A???????A???邢?̓T?|?[?g????Ă??܂???B',
'?v???????v???g?R?????V?X?e???ɍ\??????Ă??Ȃ????A?܂??͑??݂??܂???B',
'?w?肵???\?P?b?g?̎?ނ́A???̃A?h???X ?t?@?~???ŃT?|?[?g????Ă??܂???B',
'???s???悤?Ƃ???????́A?Q?Ƃ????I?u?W?F?N?g?̎?ނł̓T?|?[?g????Ă??܂???B',
'?v???g?R?? ?t?@?~?????V?X?e???ɍ\??????Ă??Ȃ????A?܂??͑??݂??܂???B',
'?v???????v???g?R???ƌ݊??????Ȃ??A?h???X???g?p???܂????B',
'?ʏ?A?e?\?P?b?g ?A?h???X?ɑ΂??ăv???g?R???A?l?b?g???[?N ?A?h???X?A?܂??̓|?[?g?̂ǂꂩ 1 ?‚݂̂??g?p?ł??܂??B',
'?v???????A?h???X?̃R???e?L?X?g???????ł??B',
'?\?P?b?g????ɂ??l?b?g???[?N?̒?~?????o????܂????B',
'???B?ł??Ȃ??l?b?g???[?N?Ń\?P?b?g????????s???悤?Ƃ??܂????B',
'????̎??s???? keep-alive ????ɂ???ăG???[?????o???ꂽ???߁A?ڑ????ؒf????܂????B',
'?m?????ꂽ?ڑ????z?X?g ?R???s???[?^?[?̃\?E?g?E?F?A?ɂ???Ē??~????܂????B',
'?????̐ڑ??̓????[?g ?z?X?g?ɋ????I?ɐؒf????܂????B',
'?V?X?e???̃o?b?t?@?[?̈悪?s?????Ă??邩?A?܂??̓L???[???????ς??Ȃ??߁A?\?P?b?g????????s?ł??܂???ł????B',
'???ɐڑ??ς݂̃\?P?b?g?ɑ΂??Đڑ???v?????܂????B',
'?\?P?b?g???ڑ?????Ă??Ȃ????Asendto ?Ăяo?????g???ăf?[?^?O???? ?\?P?b?g?ő??M????Ƃ??ɃA?h???X???w?肳??Ă??Ȃ????߁A?f?[?^?̑???M??v?????邱?Ƃ͋ւ????Ă??܂??B',
'?\?P?b?g???ȑO?̃V???b?g?_?E???̌Ăяo???ŃV???b?g?_?E??????Ă??邽?߁A?f?[?^?̑???M??v?????邱?Ƃ͋ւ????Ă??܂??B',
'????J?[?l?? ?I?u?W?F?N?g?ւ̎Q?Ƃ????????܂??B',
'?ڑ??ς݂̌Ăяo???悪???̎??Ԃ??߂??Ă??????????????Ȃ????????߁A?ڑ??ł??܂???ł????B?܂??͐ڑ??ς݂̃z?X?g?????????Ȃ????????߁A?m?????ꂽ?ڑ??͎??s???܂????B',
'?Ώۂ̃R???s???[?^?[?ɂ???ċ??ۂ??ꂽ???߁A?ڑ??ł??܂???ł????B',
'???O??ϊ??ł??܂???B',
'Filename too long',
'????̃z?X?g????~???Ă??邽?߁A?\?P?b?g????????s?ł??܂???ł????B',
'???B?ł??Ȃ??z?X?g?ɑ΂??ă\?P?b?g????????s???悤?Ƃ??܂????B',
'Windows Sockets ??????????ꍇ?A????𓯎??Ɏg?p?ł???A?v???P?[?V?????̐????????Ă???ꍇ??????܂??B',
'?N?H?[?^???s?????Ă??܂??B',
'?f?B?X?N ?N?H?[?^???s?????Ă??܂??B',
'?t?@?C?? ?n???h???̎Q?Ƃ𗘗p?ł??܂???B',
'???ڂ̓??[?J???ŗ??p?ł??܂???B',
]
def test_message
E.zip(M).each do |e, m|
assert_equal(m, e.new.message.force_encoding('cp932'), e.to_s)
end
end
end
end

(2-2/2)