Dominique Pellé wrote:
> I have a machine where running vim tests with valgrind
> always gives the following error using latest vim-7.4.2196
> (but I've seen this with earlier versions too):
>
> ===
> $ cd src/testdir
> $ make
> ....
> Executed 144 tests
> 1 FAILED:
> Found errors in Test_with_partial_callback():
> Caught exception in Test_with_partial_callback(): Vim(sleep):E118: Too
> many arguments for function: string @ function
> RunTheTest[9]..Test_with_partial_callback[8]..WaitFor, line 10
>
>
> From test_alot.vim:
> Found errors in Test_with_partial_callback():
> Caught exception in Test_with_partial_callback(): Vim(sleep):E118: Too
> many arguments for function: string @ function
> RunTheTest[9]..Test_with_partial_callback[8]..WaitFor, line 10
>
> Test results:
>
>
> From test_alot.vim:
> Found errors in Test_with_partial_callback():
> Caught exception in Test_with_partial_callback(): Vim(sleep):E118: Too
> many arguments for function: string @ function
> RunTheTest[9]..Test_with_partial_callback[8]..WaitFor, line 10
> TEST FAILURE
> Makefile:41: recipe for target 'report' failed
> make[2]: *** [report] Error 1
> make[2]: Leaving directory '/home/dope/sb/vim/src/testdir'
> Makefile:1981: recipe for target 'scripttests' failed
> make[1]: *** [scripttests] Error 2
> make[1]: Leaving directory '/home/dope/sb/vim/src'
> Makefile:36: recipe for target 'test' failed
> make: *** [test] Error 2
> ===
>
> Function Test_with_partial_callback() lin src/testdir/test_timers.vim is:
>
> 41 func Test_with_partial_callback()
> 42 let g:val = 0
> 43 let s:meow = {}
> 44 function s:meow.bite(...)
> 45 let g:val += 1
> 46 endfunction
> 47
> 48 call timer_start(50, s:meow.bite)
> 49 let slept = WaitFor('g:val == 1')
> 50 call assert_equal(1, g:val)
> 51 call assert_inrange(30, 100, slept)
> 52 endfunc
>
> Function WaitFor() in src/testdir/shared.vim is:
>
> 111 " Wait for up to a second for "expr" to become true.
> 112 " Return time slept in milliseconds.
> 113 func WaitFor(expr)
> 114 let slept = 0
> 115 for i in range(100)
> 116 try
> 117 if eval(a:expr)
> 118 return slept
> 119 endif
> 120 catch
> 121 endtry
> 122 let slept += 10
> 123 sleep 10m
> 124 endfor
> 125 endfunc
>
> Valgrind does not give errors.
> All test pass when run without valgrind.
> They also pass with the address sanitizer.
>
> Any idea why the test fails when run with valgrind?
Valgrind makes Vim a lot slower. Since the error happens in "sleep" it
suggests that a callback is called much later. Probably from a function
that's called before Test_with_partial_callback(). Since the functions
are sorted this one comes near the end:
[...]
Executing Test_window_cmd_wincmd_gf()
Executing Test_with_directories()
Executing Test_with_partial_callback()
Executing Test_with_tilde()
Executing Test_wrong_arguments()
Hmm, don't spot anything suspicious. It could very well be any callback
that, when run without valgrind, is not invoked because Vim has already
exited.
The error suggests it comes from a function('string', ...) callback.
I would suspect a call in test_partial.vim
I can't reproduce it, thus I can't try out possible fixes.
You could try changing Test_ref_job_partial_dict() to call another
function than string(). Actually, that is always wrong, since string()
only accepts one argument.
--
hundred-and-one symptoms of being an internet addict:
4. Your eyeglasses have a web site burned in on them.
/// 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.