Add minimal abstract machine module
This commit is contained in:
@@ -9,6 +9,7 @@ function(add_test_suites)
|
||||
endfunction()
|
||||
|
||||
add_test_suites(
|
||||
am_tests.c
|
||||
store_tests.c
|
||||
token_tests.c
|
||||
)
|
||||
|
||||
30
tests/am_tests.c
Normal file
30
tests/am_tests.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "am.h"
|
||||
#include "unity.h"
|
||||
|
||||
static am_t am;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
am_init(&am);
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void test_expr_value_restored_after_push_modify_pop(void)
|
||||
{
|
||||
expr_t a, b;
|
||||
am.expr = &a;
|
||||
am_push(&am);
|
||||
am.expr = &b;
|
||||
am_pop(&am);
|
||||
TEST_ASSERT_EQUAL(&a, am.expr);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_expr_value_restored_after_push_modify_pop);
|
||||
return UNITY_END();
|
||||
}
|
||||
Reference in New Issue
Block a user