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().
diff --git a/src/evalfunc.c b/src/evalfunc.c
index a5bae56..c1c8c23 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -429,6 +429,7 @@
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 @@
{"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 @@
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)