Add store into abstract machine struct

This commit is contained in:
2025-08-10 15:21:24 +01:00
parent b20a6749f7
commit d8e51b0aa0
18 changed files with 129 additions and 141 deletions

View File

@@ -1,11 +1,11 @@
#include "store.h"
#include "am.h"
#include "unity.h"
static store_t store;
static am_t am;
void setUp(void)
{
store_init(&store);
am_init(&am);
}
void tearDown(void)
@@ -14,14 +14,14 @@ void tearDown(void)
static void test_alloc_returns_non_null_after_init(void)
{
const expr_t *const expr = store_alloc(&store);
const expr_t *const expr = store_alloc(&am);
TEST_ASSERT_NOT_NULL(expr);
}
static void test_two_calls_to_alloc_return_distinct(void)
{
const expr_t *const a = store_alloc(&store);
const expr_t *const b = store_alloc(&store);
const expr_t *const a = store_alloc(&am);
const expr_t *const b = store_alloc(&am);
TEST_ASSERT_NOT_EQUAL(a, b);
}