diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-28 16:56:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-28 16:56:53 +0200 |
commit | 65a5464985f980d2bbbf4e14d39d416dce065ec7 (patch) | |
tree | 0db9a9e8471d385f544a6191b123bc01e895f9c8 /src/evalfunc.c | |
parent | 9b25af36204c0511eab08d621688f0f2008fc68e (diff) |
patch 8.0.1770: assert functions don't return anythingv8.0.1770
Problem: Assert functions don't return anything.
Solution: Return non-zero when the assertion fails.
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index dd4462d4f8..ae1425e53b 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1300,108 +1300,108 @@ f_argv(typval_T *argvars, typval_T *rettv) * "assert_beeps(cmd [, error])" function */ static void -f_assert_beeps(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_beeps(typval_T *argvars, typval_T *rettv) { - assert_beeps(argvars); + rettv->vval.v_number = assert_beeps(argvars); } /* * "assert_equal(expected, actual[, msg])" function */ static void -f_assert_equal(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_equal(typval_T *argvars, typval_T *rettv) { - assert_equal_common(argvars, ASSERT_EQUAL); + rettv->vval.v_number = assert_equal_common(argvars, ASSERT_EQUAL); } /* * "assert_equalfile(fname-one, fname-two)" function */ static void -f_assert_equalfile(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_equalfile(typval_T *argvars, typval_T *rettv) { - assert_equalfile(argvars); + rettv->vval.v_number = assert_equalfile(argvars); } /* * "assert_notequal(expected, actual[, msg])" function */ static void -f_assert_notequal(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_notequal(typval_T *argvars, typval_T *rettv) { - assert_equal_common(argvars, ASSERT_NOTEQUAL); + rettv->vval.v_number = assert_equal_common(argvars, ASSERT_NOTEQUAL); } /* * "assert_exception(string[, msg])" function */ static void -f_assert_exception(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_exception(typval_T *argvars, typval_T *rettv) { - assert_exception(argvars); + rettv->vval.v_number = assert_exception(argvars); } /* * "assert_fails(cmd [, error])" function */ static void -f_assert_fails(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_fails(typval_T *argvars, typval_T *rettv) { - assert_fails(argvars); + rettv->vval.v_number = assert_fails(argvars); } /* * "assert_false(actual[, msg])" function */ static void -f_assert_false(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_false(typval_T *argvars, typval_T *rettv) { - assert_bool(argvars, FALSE); + rettv->vval.v_number = assert_bool(argvars, FALSE); } /* * "assert_inrange(lower, upper[, msg])" function */ static void -f_assert_inrange(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_inrange(typval_T *argvars, typval_T *rettv) { - assert_inrange(argvars); + rettv->vval.v_number = assert_inrange(argvars); } /* * "assert_match(pattern, actual[, msg])" function */ static void -f_assert_match(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_match(typval_T *argvars, typval_T *rettv) { - assert_match_common(argvars, ASSERT_MATCH); + rettv->vval.v_number = assert_match_common(argvars, ASSERT_MATCH); } /* * "assert_notmatch(pattern, actual[, msg])" function */ static void -f_assert_notmatch(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_notmatch(typval_T *argvars, typval_T *rettv) { - assert_match_common(argvars, ASSERT_NOTMATCH); + rettv->vval.v_number = assert_match_common(argvars, ASSERT_NOTMATCH); } /* * "assert_report(msg)" function */ static void -f_assert_report(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_report(typval_T *argvars, typval_T *rettv) { - assert_report(argvars); + rettv->vval.v_number = assert_report(argvars); } /* * "assert_true(actual[, msg])" function */ static void -f_assert_true(typval_T *argvars, typval_T *rettv UNUSED) +f_assert_true(typval_T *argvars, typval_T *rettv) { - assert_bool(argvars, TRUE); + rettv->vval.v_number = assert_bool(argvars, TRUE); } #ifdef FEAT_FLOAT |