diff src/evalfunc.c @ 15456:f01eb1aed348 v8.1.0736

patch 8.1.0736: code for Blob not sufficiently tested commit https://github.com/vim/vim/commit/c0f5a78c15b194f23bedb82e6825e34f481e6532 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 13 15:16:13 2019 +0100 patch 8.1.0736: code for Blob not sufficiently tested Problem: Code for Blob not sufficiently tested. Solution: Add more tests. Fix uncovered crash. Add test_null_blob().
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jan 2019 15:30:08 +0100
parents 1d2b5c016f17
children 1550cc188ff6
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -429,6 +429,7 @@ static void f_test_option_not_set(typval
 static void f_test_override(typval_T *argvars, typval_T *rettv);
 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv);
 static void f_test_ignore_error(typval_T *argvars, typval_T *rettv);
+static void f_test_null_blob(typval_T *argvars, typval_T *rettv);
 #ifdef FEAT_JOB_CHANNEL
 static void f_test_null_channel(typval_T *argvars, typval_T *rettv);
 #endif
@@ -950,6 +951,7 @@ static struct fst
     {"test_feedinput",	1, 1, f_test_feedinput},
     {"test_garbagecollect_now",	0, 0, f_test_garbagecollect_now},
     {"test_ignore_error",	1, 1, f_test_ignore_error},
+    {"test_null_blob", 0, 0, f_test_null_blob},
 #ifdef FEAT_JOB_CHANNEL
     {"test_null_channel", 0, 0, f_test_null_channel},
 #endif
@@ -13902,6 +13904,13 @@ f_test_ignore_error(typval_T *argvars, t
      ignore_error_for_testing(tv_get_string(&argvars[0]));
 }
 
+    static void
+f_test_null_blob(typval_T *argvars UNUSED, typval_T *rettv)
+{
+    rettv->v_type = VAR_BLOB;
+    rettv->vval.v_blob = NULL;
+}
+
 #ifdef FEAT_JOB_CHANNEL
     static void
 f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)