diff --git a/Testing/Temporary/CTestCostData.txt b/Testing/Temporary/CTestCostData.txt new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/Testing/Temporary/CTestCostData.txt @@ -0,0 +1 @@ +--- diff --git a/Testing/Temporary/LastTest.log b/Testing/Temporary/LastTest.log new file mode 100644 index 0000000..03dc91a --- /dev/null +++ b/Testing/Temporary/LastTest.log @@ -0,0 +1,3 @@ +Start testing: Dec 21 23:21 CET +---------------------------------------------------------- +End testing: Dec 21 23:21 CET diff --git a/include/amduat/asl/store.h b/include/amduat/asl/store.h index 1becd3e..fcba0e4 100644 --- a/include/amduat/asl/store.h +++ b/include/amduat/asl/store.h @@ -37,6 +37,15 @@ typedef struct { amduat_asl_store_config_t config); } amduat_asl_store_ops_t; +static inline void amduat_asl_store_ops_init(amduat_asl_store_ops_t *ops) { + if (ops == NULL) { + return; + } + ops->put = NULL; + ops->get = NULL; + ops->validate_config = NULL; +} + typedef struct { amduat_asl_store_config_t config; amduat_asl_store_ops_t ops; diff --git a/src/adapters/asl_store_fs/asl_store_fs.c b/src/adapters/asl_store_fs/asl_store_fs.c index 8f2dae2..8b71bd3 100644 --- a/src/adapters/asl_store_fs/asl_store_fs.c +++ b/src/adapters/asl_store_fs/asl_store_fs.c @@ -693,7 +693,7 @@ bool amduat_asl_store_fs_init(amduat_asl_store_fs_t *fs, amduat_asl_store_ops_t amduat_asl_store_fs_ops(void) { amduat_asl_store_ops_t ops; - memset(&ops, 0, sizeof(ops)); + amduat_asl_store_ops_init(&ops); ops.put = amduat_asl_store_fs_put_impl; ops.get = amduat_asl_store_fs_get_impl; ops.validate_config = amduat_asl_store_fs_validate_config; diff --git a/tests/pel/test_pel_surf_run.c b/tests/pel/test_pel_surf_run.c index 85d635c..d55de64 100644 --- a/tests/pel/test_pel_surf_run.c +++ b/tests/pel/test_pel_surf_run.c @@ -363,6 +363,7 @@ static int test_surf_success(void) { cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256; stub_store_init(&stub); stub.config = cfg; + amduat_asl_store_ops_init(&ops); ops.put = stub_store_put; ops.get = stub_store_get; amduat_asl_store_init(&store, cfg, ops, &stub); @@ -488,6 +489,7 @@ static int test_surf_missing_program(void) { cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256; stub_store_init(&stub); stub.config = cfg; + amduat_asl_store_ops_init(&ops); ops.put = stub_store_put; ops.get = stub_store_get; amduat_asl_store_init(&store, cfg, ops, &stub); @@ -566,6 +568,7 @@ static int test_surf_missing_input(void) { cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256; stub_store_init(&stub); stub.config = cfg; + amduat_asl_store_ops_init(&ops); ops.put = stub_store_put; ops.get = stub_store_get; amduat_asl_store_init(&store, cfg, ops, &stub);