• Home
  • Raw
  • Download

Lines Matching refs:expr

12   struct cras_expr_expression *expr;  in TEST()  local
15 expr = cras_expr_expression_parse("#"); in TEST()
16 EXPECT_EQ(NULL, expr); in TEST()
18 expr = cras_expr_expression_parse(NULL); in TEST()
19 EXPECT_EQ(NULL, expr); in TEST()
21 cras_expr_expression_free(expr); in TEST()
25 struct cras_expr_expression *expr; in TEST() local
31 expr = cras_expr_expression_parse(" -2"); in TEST()
32 EXPECT_EQ(EXPR_TYPE_LITERAL, expr->type); in TEST()
33 EXPECT_EQ(CRAS_EXPR_VALUE_TYPE_INT, expr->u.literal.type); in TEST()
34 EXPECT_EQ(-2, expr->u.literal.u.integer); in TEST()
37 cras_expr_expression_eval(expr, &env, &value); in TEST()
41 EXPECT_EQ(0, cras_expr_expression_eval_int(expr, &env, &integer)); in TEST()
43 cras_expr_expression_free(expr); in TEST()
46 expr = cras_expr_expression_parse("\"hello\" "); in TEST()
47 EXPECT_EQ(EXPR_TYPE_LITERAL, expr->type); in TEST()
48 EXPECT_EQ(CRAS_EXPR_VALUE_TYPE_STRING, expr->u.literal.type); in TEST()
49 EXPECT_STREQ("hello", expr->u.literal.u.string); in TEST()
52 cras_expr_expression_eval(expr, &env, &value); in TEST()
57 cras_expr_expression_free(expr); in TEST()
62 struct cras_expr_expression *expr; in TEST() local
68 expr = cras_expr_expression_parse("a"); in TEST()
69 ASSERT_EQ(EXPR_TYPE_VARIABLE, expr->type); in TEST()
70 EXPECT_STREQ("a", expr->u.variable); in TEST()
73 cras_expr_expression_eval(expr, &env, &value); in TEST()
77 EXPECT_EQ(-1, cras_expr_expression_eval_int(expr, &env, &integer)); in TEST()
83 EXPECT_EQ(0, cras_expr_expression_eval_int(expr, &env, &integer)); in TEST()
87 cras_expr_expression_free(expr); in TEST()
92 struct cras_expr_expression *expr, *expr1, *expr2; in TEST() local
97 expr = cras_expr_expression_parse("()"); in TEST()
98 ASSERT_EQ(EXPR_TYPE_COMPOUND, expr->type); in TEST()
99 EXPECT_EQ(0, ARRAY_COUNT(&expr->u.children)); in TEST()
102 cras_expr_expression_eval(expr, &env, &value); in TEST()
104 cras_expr_expression_free(expr); in TEST()
107 expr = cras_expr_expression_parse("(foo bar)"); in TEST()
108 ASSERT_EQ(EXPR_TYPE_COMPOUND, expr->type); in TEST()
109 EXPECT_EQ(2, ARRAY_COUNT(&expr->u.children)); in TEST()
112 cras_expr_expression_eval(expr, &env, &value); in TEST()
114 cras_expr_expression_free(expr); in TEST()
117 expr = cras_expr_expression_parse("((foo 3)bar )"); in TEST()
118 ASSERT_EQ(EXPR_TYPE_COMPOUND, expr->type); in TEST()
119 ASSERT_EQ(2, ARRAY_COUNT(&expr->u.children)); in TEST()
121 expr1 = *ARRAY_ELEMENT(&expr->u.children, 0); in TEST()
131 cras_expr_expression_eval(expr, &env, &value); in TEST()
133 cras_expr_expression_free(expr); in TEST()
140 struct cras_expr_expression *expr; in TEST() local
148 expr = cras_expr_expression_parse("baz"); in TEST()
154 EXPECT_EQ(0, cras_expr_expression_eval_int(expr, &env1, &integer)); in TEST()
156 EXPECT_EQ(-1, cras_expr_expression_eval_int(expr, &env2, &integer)); in TEST()
162 EXPECT_EQ(0, cras_expr_expression_eval_int(expr, &env1, &integer)); in TEST()
164 EXPECT_EQ(0, cras_expr_expression_eval_int(expr, &env2, &integer)); in TEST()
168 EXPECT_EQ(-1, cras_expr_expression_eval_boolean(expr, &env2, &boolean)); in TEST()
171 cras_expr_expression_free(expr); in TEST()
178 struct cras_expr_expression *expr; in expect_int() local
181 expr = cras_expr_expression_parse(str); in expect_int()
182 cras_expr_expression_eval(expr, env, &value); in expect_int()
185 cras_expr_expression_free(expr); in expect_int()
191 struct cras_expr_expression *expr; in expect_boolean() local
194 expr = cras_expr_expression_parse(str); in expect_boolean()
195 cras_expr_expression_eval(expr, env, &value); in expect_boolean()
198 cras_expr_expression_free(expr); in expect_boolean()
202 struct cras_expr_expression *expr; in TEST() local
209 expr = cras_expr_expression_parse("or"); in TEST()
210 cras_expr_expression_eval(expr, &env, &value); in TEST()
212 cras_expr_expression_free(expr); in TEST()
229 expr = cras_expr_expression_parse("(or (equal? \"test\" a) b)"); in TEST()
233 cras_expr_expression_eval(expr, &env, &value); in TEST()
236 cras_expr_expression_free(expr); in TEST()