Dominique Pellé wrote:
> Bram Moolenaar <[email protected]> wrote:
>
> >
> > Ben Fritz wrote:
> >
> >> So, is the intent to eventually replace *all* memory allocations with
> >> this no allow testing error handling code? Or just specific areas?
> >> Example, I don't see testing of the error handling in the garbage
> >> collector.
> >
> > That would be a lot of work. At least this helps someone who wants to
> > get 100% coverage for some part of the code.
> >
> >> Wouldn't it be better to use an enum rather than a comment about the
> >> current max ID? Much easier to search that way and less error-prone.
> >
> > It would require an enum with fixed numbers. Otherwise removing an
> > entry would break tests, since those will need to use numbers.
> > Might as well just use the number. It doesn't matter if there are gaps.
> > If the same number is used twice there is no error, but the test might
> > fail. Or it might just work.
>
> SQLite is tested with 100% coverage, including error paths
> with dynamic allocation failure (OOM), I/O errors, etc.
> Some information can be found here:
>
> https://www.sqlite.org/malloc.html
> https://www.sqlite.org/testing.html
>
> But probably this is overkill for Vim.
800 times more test code than actual code...
> Perhaps something easier is to inject, for test purpose,
> some random allocation failures and test with asan.
When an allocation fails we need to check for expected behavior, the way
the current operation fails. That doesn't work with random failures.
Unless you only want to check for memory leaks or invalid memory
accesses.
--
TERRY GILLIAM PLAYED: PATSY (ARTHUR'S TRUSTY STEED), THE GREEN KNIGHT
SOOTHSAYER, BRIDGEKEEPER, SIR GAWAIN (THE FIRST TO BE
KILLED BY THE RABBIT)
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.