aboutsummaryrefslogtreecommitdiff
path: root/test/unit
Commit message (Collapse)AuthorAge
* test: avoid extra clear() callsJustin M. Keyes2017-10-02
| | | | also: various other cleanup
* win: vim_FullName(): force backslashes #7287Ignas Anikevicius2017-10-02
| | | | | | | | | - Replace obvious cases of '/' literal with PATHSEP. (There are still some remaining cases that need closer inspection.) - Fixup tests: ui/screen_basic closes #7117 ref https://github.com/neovim/neovim/issues/2471#issuecomment-271193714
* os_stat: return ENOENT on NULL filename argJames McCoy2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #4370 Explication: In the backtrace in #4370, we see that `buf_write()` was called with non-NULL `fname` and `sfname` arguments, but they've since _become_ NULL. #7 0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go", sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0, forceit=0, reset_changed=1, filtering=0) at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576 This is most likely due to the code that restores those values from `buf`, which happens just before the fatal call to `os_fileinfo` ```c /* * The autocommands may have changed the name of the buffer, which may * be kept in fname, ffname and sfname. */ if (buf_ffname) ffname = buf->b_ffname; if (buf_sfname) sfname = buf->b_sfname; if (buf_fname_f) fname = buf->b_ffname; if (buf_fname_s) fname = buf->b_sfname; ``` It's worth noting that at this point `ffname` is still non-NULL, so it _could_ be used. However, our current code is purely more strict than Vim in this area, which has caused us problems before (e.g., `getdigits()`). The commentary for `struct file_buffer` clearly indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be NULL: ```c /* * b_ffname has the full path of the file (NULL for no name). * b_sfname is the name as the user typed it (or NULL). * b_fname is the same as b_sfname, unless ":cd" has been done, * then it is the same as b_ffname (NULL for no name). */ char_u *b_ffname; /* full path file name */ char_u *b_sfname; /* short file name */ char_u *b_fname; /* current file name */ ``` Vim directly calls `stat(2)` which, although it is annotated to tell the compiler that the path argument is non-NULL, does handle a NULL pointer by returning a `-1` value and setting `errno` to `EFAULT`. This satisfies Vim's check, since it treats any `-1` return from `stat(2)` to mean the file doesn't exist (at least in this code path). Note that Vim's mch_stat() implementations on win32 and solaris clearly cannot accept NULL `name`. But the codepaths that call mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
* os/fileio: Add ability to use os/fileio.c for file descriptorsZyX2017-07-04
| | | | Code imported from #6299
* os/fileio: Add msgpack_file_write functionZyX2017-07-04
|
* Merge #6947 from ZyX-I/consistent-get_keymapJustin M. Keyes2017-07-03
|\
| * unittests: Fix allocation ordering for tv_dict_add_str()ZyX2017-07-02
| |
| * eval/typval: Add tv_dict_add_allocated_str() functionZyX2017-07-02
| |
* | test: expand_env_esc: Pass correct buffer size for outlen and assertionJames McCoy2017-07-02
|/ | | | | | | | Running this test with a mocked passwd file whose $HOME was set to /home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome caused the test to fail, since the expanded result was >= 99 bytes. The test should be reflecting the actual size of the buffer, instead of some arbitrary other number, anwyay.
* test: fix bashisms (#6791)Jonathan de Boyne Pollard2017-06-01
|
* startup: v:progpath fallback: path_guess_exepathJustin M. Keyes2017-05-15
| | | | | | | If procfs is missing then libuv cannot find the exe path. Fallback to path_guess_exepath(), adapted from Vim findYourself(). Closes #6734
* eval: Refactor get_user_input to support dictionaryZyX2017-05-10
|
* tests: Add tests for vim_strchrZyX2017-05-09
|
* test/fs: sanity check for literal "~" directory (#6579)Justin M. Keyes2017-04-24
| | | | If the CWD contains a directory with the literal name "~" then the tests will have bogus failures.
* Merge branch 'master' into lazier-arg_errmsg-gettextZyX2017-04-21
|\
| * *: Add comment to all C filesZyX2017-04-19
| |
* | unittests: Add a test for TV_CSTRINGZyX2017-04-14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not using enum{} because SIZE_MAX exceeds integer and I do not really like how enum definition is described in C99: 1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type to choose is still implementation-defined. 2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration constant has type `int`”. So it looks like “no matter what type was chosen for enumeration, constants will be integers”. Yet the following simple program: #include <stdint.h> #include <stdio.h> #include <stddef.h> enum { X=SIZE_MAX }; int main(int argc, char **argv) { printf("x:%zu m:%zu t:%zu v:%zu", sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X); } yields one of the following using different compilers: - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615` - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161` If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8 v:4294967295`, other compilers’ output does not change. All compilers were called with `$compiler -std=c99 -xc -` (feeding program from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to ignore the argument though: it is perfectly fine with `-std=c1000`.
* win: os_shell_is_cmdexe() + testsJustin M. Keyes2017-04-12
|
* Merge #6439 from ZyX-I/fix-gc-failuresJustin M. Keyes2017-04-09
|\ | | | | unittests: Force GC, fix GC failures in typval_spec
| * unittests: Move allocating vimconv_T to a functionZyX2017-04-09
| |
| * unittests: Do not GC typval_T which is owned by a diZyX2017-04-09
| |
| * unittests: Do not unref partial which is owned by Callback structureZyX2017-04-09
| |
| * unittests: Use Neovim memory allocation for vimconv_TZyX2017-04-09
| | | | | | | | Not sure whether this is going to fix things though, but core dump does not contain Neovim functions in stack in this case.
| * unittests: Do not gc what is already freedZyX2017-04-09
| |
| * unittests: Move checking cores to check_child_errZyX2017-04-08
| |
| * unittests: Fix testlint failureZyX2017-04-07
| |
| * unittests: Force GC, fix GC failures in typval_specZyX2017-04-06
| |
* | unittests: Fix linter errorZyX2017-04-09
| |
* | unittests: Do not alter p_enc in decode unit testZyX2017-04-08
|/
* tests: Fix testlint errorsZyX2017-04-03
|
* eval: Make writefile() able to disable fsync()ZyX2017-04-02
|
* unittests: Make it easier to determine on which _spec line it crashed (#6424)Nikolai Aleksandrovich Pavlov2017-04-02
| | | | | | Benchmarks: Before change: 17.78s user 3.48s system 94% cpu 22.525 total After change: 25.38s user 4.46s system 101% cpu 29.317 total
* Merge #6422 from ZyX-I/fix-6420Justin M. Keyes2017-04-01
|\ | | | | eval,fileio: Omit additional fsync() call
| * eval,fileio: Omit additional fsync() callZyX2017-04-01
| | | | | | | | Fixes #6420
* | unittests: Replace two environment variables with one TRACE_LEVELZyX2017-04-01
| |
* | unittests: Fix linter errorZyX2017-04-01
| |
* | unittests: Disable non-C-callsZyX2017-04-01
| | | | | | | | | | | | | | Some benchmarks: TRACE_EVERYTHING: 79.45s user 12.68s system 124% cpu 1:13.94 total (default): 30.26s user 5.30s system 89% cpu 39.663 total
* | unittests: Add trace description right to the error messageZyX2017-04-01
| |
* | unittests: Collect tracesZyX2017-04-01
| | | | | | | | | | | | | | | | | | | | | | Some benchmarks: MAIN_CDEFS + NO_TRACE: 3.81s user 1.65s system 33% cpu 16.140 total MAIN_CDEFS: 73.61s user 10.98s system 154% cpu 54.690 total NO_TRACE: 18.49s user 4.30s system 73% cpu 30.804 total (default): 77.11s user 14.74s system 126% cpu 1:12.79 total
* | unittests: Split itp implementation into multiple functionsZyX2017-04-01
| |
* | unittests: Do not hang when error message is too longZyX2017-04-01
|/
* ci: Do not hide ci directory (#6410)Nikolai Aleksandrovich Pavlov2017-03-31
|
* eval/typval,api/buffer: Fix review commentsZyX2017-03-29
|
* eval/typval: Allow NULL dict as tv_dict_get_callback() argumentZyX2017-03-29
| | | Also removes NULL key input: tv_dict_find() does not allow this.
* unittests: Fix linter errorsZyX2017-03-29
|
* unittests: Add tv_get_string* testsZyX2017-03-29
|
* unittests: Add tv_get number testsZyX2017-03-29
|
* unittests: Move tv_dict_add* tests to a proper describe() blockZyX2017-03-29
|
* unittests: Add tv_check… testsZyX2017-03-29
|
* unittests: Add tv_equal() testsZyX2017-03-29
|