Lines Matching defs:test
60 static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
65 TEST_ASSERT_VAL("parse test failed", 0);
93 ret = test(ctx, "1+1", 2);
94 ret |= test(ctx, "FOO+BAR", 3);
95 ret |= test(ctx, "(BAR/2)%2", 1);
96 ret |= test(ctx, "1 - -4", 5);
97 ret |= test(ctx, "(FOO-1)*2 + (BAR/2)%2 - -4", 5);
98 ret |= test(ctx, "1-1 | 1", 1);
99 ret |= test(ctx, "1-1 & 1", 0);
100 ret |= test(ctx, "min(1,2) + 1", 2);
101 ret |= test(ctx, "max(1,2) + 1", 3);
102 ret |= test(ctx, "1+1 if 3*4 else 0", 2);
103 ret |= test(ctx, "100 if 1 else 200 if 1 else 300", 100);
104 ret |= test(ctx, "100 if 0 else 200 if 1 else 300", 200);
105 ret |= test(ctx, "100 if 1 else 200 if 0 else 300", 100);
106 ret |= test(ctx, "100 if 0 else 200 if 0 else 300", 300);
107 ret |= test(ctx, "1.1 + 2.1", 3.2);
108 ret |= test(ctx, ".1 + 2.", 2.1);
109 ret |= test(ctx, "d_ratio(1, 2)", 0.5);
110 ret |= test(ctx, "d_ratio(2.5, 0)", 0);
111 ret |= test(ctx, "1.1 < 2.2", 1);
112 ret |= test(ctx, "2.2 > 1.1", 1);
113 ret |= test(ctx, "1.1 < 1.1", 0);
114 ret |= test(ctx, "2.2 > 2.2", 0);
115 ret |= test(ctx, "2.2 < 1.1", 0);
116 ret |= test(ctx, "1.1 > 2.2", 0);
117 ret |= test(ctx, "1.1e10 < 1.1e100", 1);
118 ret |= test(ctx, "1.1e2 > 1.1e-2", 1);
266 ret = test(ctx, "strcmp_cpuid_str(0x0)", 0);
281 ret |= test(ctx, strcmp_cpuid_buf, 1);
285 ret |= test(ctx, "has_event(cycles)", 1);