summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
AgeCommit message (Collapse)Author
2012-04-19Fix multithread issue in the test of r35391naruse
pipe() uses threads and its reader thread may work before the writer writes "foob". On such case, the reader will raise error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-18* io.c (io_readpartial): Document the output buffer parameter isdrbrain
overwritten with the read contents even when non-empty. Patch by yu nobuoka. [ruby-trunk - Bug #6285] * io.c (io_read_nonblock): ditto. * io.c (io_read): ditto. * io.c (rb_io_sysread): ditto. * io.c (argf_read): ditto. * io.c (argf_readpartial): ditto. * ext/stringio/stringio.c (strio_read): ditto. * test/ruby/test_argf.rb (class TestArgf): Add test for existing behavior of read outbuf. * test/ruby/test_io.rb (class TestIO): ditto. * test/stringio/test_stringio.rb (class TestStringIO): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08Decrease the default level of try_fdopen.naruse
Because it cause Bus Error: http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20120407T230202Z.log.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-23* test/ruby/test_io.rb (try_fdopen): more GCable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22* test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.usa
see [ruby-core:43550] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-21* test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.usa
see [Bug #6179][ruby-core:43518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-09Rescue even if it test_readpartial_locktmp RuntimeError. [Bug#6099]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-29* test/ruby/test_io.rb (TestIO#test_readpartial_locktmp): skip onusa
windows because of the platform restriction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28* io.c (io_fread, io_getpartial, rb_io_sysread): set buffer sizenobu
after check if readable, which can cause thread switch. [ruby-dev:45297][Bug #6099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27forgotten to commit at r34834.usa
* test/ruby/test_io.rb (TestIO#test_setpos): use binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_extract_modeenc): fail only if conflictingnobu
text/binary modes given explicitly. [ruby-dev:45268][Bug #6055] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_s_foreach): argument check before making Enumerator.nobu
[ruby-dev:31525] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_s_foreach): return enumerator including kerwordnobu
arguments. [ruby-dev:45267][Bug #6054] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15Add test for r34624.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-13* io.c (io_setstrbuf): defer resizing buffer string until data isnobu
read actually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18Suppress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09* test/ruby/test_io.rb (test_autoclose_true_closed_by_finalizer,nagachika
test_autoclose_true_closed_by_finalizer): skip if IO objects are not recycled yet. [ruby-dev:45098] [Bug #5850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn'tusa
accept the block argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-27Run the test only if /dev/tty exists.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-25* io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linuxkosaki
specific narg length calculation. * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and unstructured ioctl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-24* test/openssl/test_engine.rb: use IO#reopen to restore stderr.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-24add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-23* io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.naruse
On Linux some constants for ioctl(2) doesn't include the size of its return value and 16bit value; for example FIONREAD 0x541B. Moreover the manual, ioctl_list(2), says "Note that the size bits are very unreliable: in lots of cases they are wrong, either because of buggy macros using sizeof(sizeof(struct)), or because of legacy values." So we shouldn't use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21* test/ruby/test_io.rb (test_fcntl_dupfd): there is no known platformakr
which don't have F_DUPFD. [ruby-dev:44874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21* test/ruby/test_io.rb (test_fcntl_dupfd): the argument of F_DUPFD isakr
minimum file descriptor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15* test/ruby/test_io.rb (TestIO#test_fcntl_dupfd): fix OpenBSD testkosaki
failure. [ruby-dev:44872] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14revert r33752 and fix test case based [ruby-dev:44866].ayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* test/ruby/test_io.rb (test_fcntl_dupfd): fix test error onayumin
SnowLeopard. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* test/ruby/test_io.rb (test_fcntl_dupfd): skip if Fcntl::DUPFDkosaki
is not defined. Pointed out by CHIKANAGA Tomoyuki. Thanks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* test/ruby/test_io.rb (test_fcntl_dupfd): add another fcntl test.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* test/ruby/test_io.rb (test_fcntl_lock_freebsd): add a testcasekosaki
of fcntl lock for freebsd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.kosaki
Moreover almost all linux ioctl can't be represented by 32bit integer (i.e. MSB is 1). We need wrap ioctl argument type. [Bug #5429] [ruby-dev:44589] * io.c (struct ioctl_arg): ditto. * io.c (rb_ioctl): ditto. * test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03add test for close-on-exec.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23* io.c (copy_stream_fallback_body): check nil for EOF of read method.akr
patch by Eric Wong. [ruby-core:39134] [Bug #5237] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* io.c (rb_fd_set_cloexec): new function. (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag. (rb_sysopen_internal): ditto. (rb_pipe): ditto. (io_reopen): ditto. (io_cntl): ditto. * process.c (rb_f_exec): change the default :close_others option to true. (rb_f_system): ditto. (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set close-on-exec flag. (ruby_setsid): ditto. (rb_daemon): ditto. * thread_pthread.c (rb_thread_create_timer_thread): call rb_fd_set_cloexec to set close-on-exec flag. * ruby.c (load_file_internal): ditto. * file.c (rb_file_s_truncate): ditto. (file_load_ok): ditto. * random.c (fill_random_seed): ditto. * ext/pty/pty.c (chfunc): ditto. (get_device_once): ditto. * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto. * ext/socket/init.c (rsock_socket): ditto. (rsock_s_accept_nonblock): ditto. (rsock_s_accept): ditto. * ext/socket/socket.c (rsock_sock_s_socketpair): ditto. * ext/socket/ancdata.c (discard_cmsg): ditto. (make_io_for_unix_rights): ditto. * ext/socket/unixsocket.c (unix_recv_io): ditto. * ext/io/console/console.c (console_dev): ditto. [ruby-core:38140] [Feature #5041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30* io.c (rb_io_each_byte): rbuf can be refreshed during yield.nobu
[Bug #5119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17* error.c (rb_warn_m): accept multiple args in like puts. rdocnobu
patch by Erik Price at [ruby-core:38119]. [Feature #5029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* io.c (fill_cbuf): finish reading at EOF, and the readconv hasnobu
been cleared by another thread while io_fillbuf() is waiting at select(). a patch in [ruby-core:37197] by Hiroshi Shirosaki <h.shirosaki AT gmail.com>. fixed #3840 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16* test/ruby/test_io.rb (TestIO#test_copy_stream_socket): fixkosaki
test hanging up issue. Patch by CHIKANAGA Tomoyuki. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-15* test/ruby/test_io.rb (test_copy_stream_socket): wait a child processakr
before SIGUSR1 handler is removed. * test/pathname/test_pathname.rb (define_assertion): use line number for test method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* io.c: fix IO.copy_stream interrupt handling.akr
based on the patch by Eric Wong. [ruby-core:36156] * vm_core.h (rb_thread_call_with_gvl): don't declare here. * thread.c: include internal.h. (rb_thread_execute_interrupts): new function. * internal.h (rb_thread_execute_interrupts): declared. (rb_thread_call_with_gvl): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-06* test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a filekazu
under /tmp. [Bug #4846] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-02* io.c: Add File.write, File.binwrite. [Feature #1081] [ruby-core:21701]sorah
* test/ruby/test_io.rb: Test for File.write, File.binwrite. * NEWS: News for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31* test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resourcesusa
explicitly. fix problem of r31671 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-27* test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop.nobu
* test/ruby/test_signal.rb (TestSignal#test_signal2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-21* io.c (rb_io_extract_modeenc): accept combination hash andkosaki
File::Constants. (eg. File.open('yo', :mode => File::WRONLY)) [Feature #4742][ruby-core:36338] * test/ruby/test_io.rb (TestIO#test_open_mode): new test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19revert O_CLOEXEC patch series completely.kosaki
because boron chkbuild test result says, An old linux kernel ignore O_CLOEXEC silently instead of return an error. It may lead to bring new security risk. So, we have to be pending it until finish to implement proper fallback logic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-17* test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): add null check.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07* test/ruby/test_io.rb (TestIO#test_readpartial_lock),nobu
(TestIO#test_read_lock): get rid of GVL fairness problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-05* test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): fix false positivekosaki
detection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e