Lines Matching refs:test
9 static int test(struct expr_parse_ctx *ctx, const char *e, double val2) in test() function
19 int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) in test__expr()
31 ret = test(&ctx, "1+1", 2); in test__expr()
32 ret |= test(&ctx, "FOO+BAR", 3); in test__expr()
33 ret |= test(&ctx, "(BAR/2)%2", 1); in test__expr()
34 ret |= test(&ctx, "1 - -4", 5); in test__expr()
35 ret |= test(&ctx, "(FOO-1)*2 + (BAR/2)%2 - -4", 5); in test__expr()
36 ret |= test(&ctx, "1-1 | 1", 1); in test__expr()
37 ret |= test(&ctx, "1-1 & 1", 0); in test__expr()
38 ret |= test(&ctx, "min(1,2) + 1", 2); in test__expr()
39 ret |= test(&ctx, "max(1,2) + 1", 3); in test__expr()
40 ret |= test(&ctx, "1+1 if 3*4 else 0", 2); in test__expr()
41 ret |= test(&ctx, "1.1 + 2.1", 3.2); in test__expr()
42 ret |= test(&ctx, ".1 + 2.", 2.1); in test__expr()
43 ret |= test(&ctx, "d_ratio(1, 2)", 0.5); in test__expr()
44 ret |= test(&ctx, "d_ratio(2.5, 0)", 0); in test__expr()
45 ret |= test(&ctx, "1.1 < 2.2", 1); in test__expr()
46 ret |= test(&ctx, "2.2 > 1.1", 1); in test__expr()
47 ret |= test(&ctx, "1.1 < 1.1", 0); in test__expr()
48 ret |= test(&ctx, "2.2 > 2.2", 0); in test__expr()
49 ret |= test(&ctx, "2.2 < 1.1", 0); in test__expr()
50 ret |= test(&ctx, "1.1 > 2.2", 0); in test__expr()