Patch 7.4.1807
Problem: Test_out_close_cb sometimes fails.
Solution: Always write DETACH to out, not err.
Files: src/channel.c, src/testdir/test_channel.vim
*** ../vim-7.4.1806/src/channel.c 2016-04-26 20:30:03.360916990 +0200
--- src/channel.c 2016-04-30 16:00:42.391467986 +0200
***************
*** 2478,2483 ****
--- 2478,2484 ----
* first invoke the close callback. Increment the refcount to avoid
* the channel being freed halfway. */
++channel->ch_refcount;
+ ch_log(channel, "Invoking callbacks before closing");
for (part = PART_SOCK; part <= PART_ERR; ++part)
while (may_invoke_callback(channel, part))
;
***************
*** 2783,2789 ****
*/
if (channel->ch_part[part].ch_mode == MODE_RAW
|| channel->ch_part[part].ch_mode == MODE_NL)
! channel_save(channel, part, (char_u *)DETACH_MSG_RAW,
(int)STRLEN(DETACH_MSG_RAW), FALSE, "PUT ");
/* When reading from stdout is not possible, assume the other side has
--- 2784,2790 ----
*/
if (channel->ch_part[part].ch_mode == MODE_RAW
|| channel->ch_part[part].ch_mode == MODE_NL)
! channel_save(channel, PART_OUT, (char_u *)DETACH_MSG_RAW,
(int)STRLEN(DETACH_MSG_RAW), FALSE, "PUT ");
/* When reading from stdout is not possible, assume the other side has
*** ../vim-7.4.1806/src/testdir/test_channel.vim 2016-04-26
19:01:00.957118797 +0200
--- src/testdir/test_channel.vim 2016-04-30 16:04:08.469150252 +0200
***************
*** 1055,1064 ****
call ch_log('Test_out_close_cb()')
let s:counter = 1
! let s:outmsg = 0
let s:closemsg = 0
func! OutHandler(chan, msg)
! let s:outmsg = s:counter
let s:counter += 1
endfunc
func! CloseHandler(chan)
--- 1055,1069 ----
call ch_log('Test_out_close_cb()')
let s:counter = 1
! let s:msg1 = ''
! let s:msg2 = ''
let s:closemsg = 0
func! OutHandler(chan, msg)
! if s:counter == 1
! let s:msg1 = a:msg
! else
! let s:msg2 = a:msg
! endif
let s:counter += 1
endfunc
func! CloseHandler(chan)
***************
*** 1070,1078 ****
\ 'close_cb': 'CloseHandler'})
call assert_equal("run", job_status(job))
try
! call s:waitFor('s:closemsg != 0 && s:outmsg != 0')
! call assert_equal(1, s:outmsg)
! call assert_equal(2, s:closemsg)
finally
call job_stop(job)
delfunc OutHandler
--- 1075,1084 ----
\ 'close_cb': 'CloseHandler'})
call assert_equal("run", job_status(job))
try
! call s:waitFor('s:closemsg != 0 && s:msg2 != ""')
! call assert_equal('quit', s:msg1)
! call assert_equal('DETACH', s:msg2)
! call assert_equal(3, s:closemsg)
finally
call job_stop(job)
delfunc OutHandler
*** ../vim-7.4.1806/src/version.c 2016-04-30 15:17:06.949150618 +0200
--- src/version.c 2016-04-30 15:59:21.612384978 +0200
***************
*** 755,756 ****
--- 755,758 ----
{ /* Add new patch number below this line */
+ /**/
+ 1807,
/**/
--
Q: Why does /dev/null accept only integers?
A: You can't sink a float.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.