Add register parameter to AM stack operations
This commit is contained in:
@@ -20,13 +20,25 @@ static void test_expr_value_restored_after_push_modify_pop(void)
|
||||
expr_t a, b;
|
||||
|
||||
am.regs[EXPR] = &a;
|
||||
am_push(&am);
|
||||
am_push(&am, EXPR);
|
||||
am.regs[EXPR] = &b;
|
||||
am_pop(&am);
|
||||
am_pop(&am, EXPR);
|
||||
|
||||
TEST_ASSERT_EQUAL(&a, am.regs[EXPR]);
|
||||
}
|
||||
|
||||
static void test_argl_value_restored_after_push_modify_pop(void)
|
||||
{
|
||||
expr_t a, b;
|
||||
|
||||
am.regs[ARGL] = &a;
|
||||
am_push(&am, ARGL);
|
||||
am.regs[ARGL] = &b;
|
||||
am_pop(&am, ARGL);
|
||||
|
||||
TEST_ASSERT_EQUAL(&a, am.regs[ARGL]);
|
||||
}
|
||||
|
||||
static void test_append_arg_42_with_empty_argl(void)
|
||||
{
|
||||
am.regs[ARGL] = expr_empty_list(&am);
|
||||
@@ -48,6 +60,7 @@ int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_expr_value_restored_after_push_modify_pop);
|
||||
RUN_TEST(test_argl_value_restored_after_push_modify_pop);
|
||||
RUN_TEST(test_append_arg_42_with_empty_argl);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user