patch 7.4.1096
Problem: Need several lines to verify a command produces an error.
Solution: Add assert_fails(). (suggested by Nikolay Pavlov)
Make the quickfix alloc test actually work.
diff --git a/src/misc2.c b/src/misc2.c
index 8540212..0ee57fc 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -798,13 +798,17 @@
#endif /* MEM_PROFILE */
#ifdef FEAT_EVAL
+static int alloc_does_fail __ARGS((long_u size));
+
static int
-alloc_does_fail()
+alloc_does_fail(size)
+ long_u size;
{
if (alloc_fail_countdown == 0)
{
if (--alloc_fail_repeat <= 0)
alloc_fail_id = 0;
+ do_outofmem_msg(size);
return TRUE;
}
--alloc_fail_countdown;
@@ -844,7 +848,7 @@
alloc_id_T id UNUSED;
{
#ifdef FEAT_EVAL
- if (alloc_fail_id == id && alloc_does_fail())
+ if (alloc_fail_id == id && alloc_does_fail((long_u)size))
return NULL;
#endif
return (lalloc((long_u)size, TRUE));
@@ -1008,7 +1012,7 @@
alloc_id_T id UNUSED;
{
#ifdef FEAT_EVAL
- if (alloc_fail_id == id && alloc_does_fail())
+ if (alloc_fail_id == id && alloc_does_fail(size))
return NULL;
#endif
return (lalloc((long_u)size, message));