comparison 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
comparison
equal deleted inserted replaced
15455:4e2baf1fe3eb 15456:f01eb1aed348
427 static void f_test_feedinput(typval_T *argvars, typval_T *rettv); 427 static void f_test_feedinput(typval_T *argvars, typval_T *rettv);
428 static void f_test_option_not_set(typval_T *argvars, typval_T *rettv); 428 static void f_test_option_not_set(typval_T *argvars, typval_T *rettv);
429 static void f_test_override(typval_T *argvars, typval_T *rettv); 429 static void f_test_override(typval_T *argvars, typval_T *rettv);
430 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv); 430 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv);
431 static void f_test_ignore_error(typval_T *argvars, typval_T *rettv); 431 static void f_test_ignore_error(typval_T *argvars, typval_T *rettv);
432 static void f_test_null_blob(typval_T *argvars, typval_T *rettv);
432 #ifdef FEAT_JOB_CHANNEL 433 #ifdef FEAT_JOB_CHANNEL
433 static void f_test_null_channel(typval_T *argvars, typval_T *rettv); 434 static void f_test_null_channel(typval_T *argvars, typval_T *rettv);
434 #endif 435 #endif
435 static void f_test_null_dict(typval_T *argvars, typval_T *rettv); 436 static void f_test_null_dict(typval_T *argvars, typval_T *rettv);
436 #ifdef FEAT_JOB_CHANNEL 437 #ifdef FEAT_JOB_CHANNEL
948 {"test_alloc_fail", 3, 3, f_test_alloc_fail}, 949 {"test_alloc_fail", 3, 3, f_test_alloc_fail},
949 {"test_autochdir", 0, 0, f_test_autochdir}, 950 {"test_autochdir", 0, 0, f_test_autochdir},
950 {"test_feedinput", 1, 1, f_test_feedinput}, 951 {"test_feedinput", 1, 1, f_test_feedinput},
951 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, 952 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now},
952 {"test_ignore_error", 1, 1, f_test_ignore_error}, 953 {"test_ignore_error", 1, 1, f_test_ignore_error},
954 {"test_null_blob", 0, 0, f_test_null_blob},
953 #ifdef FEAT_JOB_CHANNEL 955 #ifdef FEAT_JOB_CHANNEL
954 {"test_null_channel", 0, 0, f_test_null_channel}, 956 {"test_null_channel", 0, 0, f_test_null_channel},
955 #endif 957 #endif
956 {"test_null_dict", 0, 0, f_test_null_dict}, 958 {"test_null_dict", 0, 0, f_test_null_dict},
957 #ifdef FEAT_JOB_CHANNEL 959 #ifdef FEAT_JOB_CHANNEL
13900 f_test_ignore_error(typval_T *argvars, typval_T *rettv UNUSED) 13902 f_test_ignore_error(typval_T *argvars, typval_T *rettv UNUSED)
13901 { 13903 {
13902 ignore_error_for_testing(tv_get_string(&argvars[0])); 13904 ignore_error_for_testing(tv_get_string(&argvars[0]));
13903 } 13905 }
13904 13906
13907 static void
13908 f_test_null_blob(typval_T *argvars UNUSED, typval_T *rettv)
13909 {
13910 rettv->v_type = VAR_BLOB;
13911 rettv->vval.v_blob = NULL;
13912 }
13913
13905 #ifdef FEAT_JOB_CHANNEL 13914 #ifdef FEAT_JOB_CHANNEL
13906 static void 13915 static void
13907 f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv) 13916 f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)
13908 { 13917 {
13909 rettv->v_type = VAR_CHANNEL; 13918 rettv->v_type = VAR_CHANNEL;