0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.0.0392: GUI test fails with Athena and Motif

Problem:    GUI test fails with Athena and Motif.
Solution:   Add test_ignore_error().  Use it to ignore the "failed to create
            input context" error.
This commit is contained in:
Bram Moolenaar
2017-03-01 15:07:05 +01:00
parent 5f53dd3f74
commit e0c31f6a30
6 changed files with 58 additions and 0 deletions

View File

@@ -539,6 +539,31 @@ emsg_not_now(void)
return FALSE;
}
#ifdef FEAT_EVAL
static garray_T ignore_error_list = GA_EMPTY;
void
ignore_error_for_testing(char_u *error)
{
if (ignore_error_list.ga_itemsize == 0)
ga_init2(&ignore_error_list, sizeof(char_u *), 1);
ga_add_string(&ignore_error_list, error);
}
static int
ignore_error(char_u *msg)
{
int i;
for (i = 0; i < ignore_error_list.ga_len; ++i)
if (strstr((char *)msg,
(char *)((char_u **)(ignore_error_list.ga_data))[i]) != NULL)
return TRUE;
return FALSE;
}
#endif
#if !defined(HAVE_STRERROR) || defined(PROTO)
/*
* Replacement for perror() that behaves more or less like emsg() was called.
@@ -577,6 +602,12 @@ emsg(char_u *s)
if (emsg_not_now())
return TRUE;
#ifdef FEAT_EVAL
/* When testing some errors are turned into a normal message. */
if (ignore_error(s))
return msg(s);
#endif
called_emsg = TRUE;
/*