From 8a4563d6d0c9e81fdaa42f6f760cae2b49cad431 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Fri, 31 Jul 2026 00:06:20 +0200 Subject: Adds unit test framework --- core/salis.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'core/salis.c') diff --git a/core/salis.c b/core/salis.c index 93dc842..6cc0725 100644 --- a/core/salis.c +++ b/core/salis.c @@ -360,6 +360,13 @@ static void core_save(const struct Core *core, FILE *f) { arch_core_save(core, f); } +void core_event_array_init(struct EventArray *eva) { + assert(eva); + eva->params.size = sizeof(uint64_t) * MVEC_SIZE; + eva->params.in = (Bytef *)eva->data; + eva->params.out = (Bytef *)eva->comp; +} + #if defined(COMMAND_NEW) static void core_assemble_ancestor(struct Core *core) { assert(core); @@ -381,13 +388,6 @@ static void core_assemble_ancestor(struct Core *core) { } } -void core_event_array_init(struct EventArray *eva) { - assert(eva); - eva->params.size = sizeof(uint64_t) * MVEC_SIZE; - eva->params.in = (Bytef *)eva->data; - eva->params.out = (Bytef *)eva->comp; -} - static void core_init(struct Core *core, uint64_t *seed) { assert(core); assert(seed); @@ -460,6 +460,10 @@ static void core_load(struct Core *core, FILE *f) { fread(core->eeva.data, sizeof(uint64_t), MVEC_SIZE, f); fread(core->beva.data, sizeof(uint64_t), MVEC_SIZE, f); + core_event_array_init(&core->aeva); + core_event_array_init(&core->eeva); + core_event_array_init(&core->beva); + arch_core_load(core, f); } #endif -- cgit v1.3.1