p = "FOO/0";
ret = expr__parse(&val, &ctx, p);
- TEST_ASSERT_VAL("division by zero", ret == 1);
+ TEST_ASSERT_VAL("division by zero", ret == -1);
p = "BAR/";
ret = expr__parse(&val, &ctx, p);
- TEST_ASSERT_VAL("missing operand", ret == 1);
+ TEST_ASSERT_VAL("missing operand", ret == -1);
TEST_ASSERT_VAL("find other",
expr__find_other("FOO + BAR + BAZ + BOZO", "FOO", &other, &num_other) == 0);
int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr)
{
- return __expr__parse(final_val, ctx, expr, EXPR_PARSE);
+ return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0;
}
static bool