Implement store error IO class, optional config validation, and ops init helper
This commit is contained in:
parent
a992e89766
commit
9754582ae7
1
Testing/Temporary/CTestCostData.txt
Normal file
1
Testing/Temporary/CTestCostData.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
---
|
||||||
3
Testing/Temporary/LastTest.log
Normal file
3
Testing/Temporary/LastTest.log
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
Start testing: Dec 21 23:21 CET
|
||||||
|
----------------------------------------------------------
|
||||||
|
End testing: Dec 21 23:21 CET
|
||||||
|
|
@ -37,6 +37,15 @@ typedef struct {
|
||||||
amduat_asl_store_config_t config);
|
amduat_asl_store_config_t config);
|
||||||
} amduat_asl_store_ops_t;
|
} 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 {
|
typedef struct {
|
||||||
amduat_asl_store_config_t config;
|
amduat_asl_store_config_t config;
|
||||||
amduat_asl_store_ops_t ops;
|
amduat_asl_store_ops_t ops;
|
||||||
|
|
|
||||||
|
|
@ -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 amduat_asl_store_fs_ops(void) {
|
||||||
amduat_asl_store_ops_t ops;
|
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.put = amduat_asl_store_fs_put_impl;
|
||||||
ops.get = amduat_asl_store_fs_get_impl;
|
ops.get = amduat_asl_store_fs_get_impl;
|
||||||
ops.validate_config = amduat_asl_store_fs_validate_config;
|
ops.validate_config = amduat_asl_store_fs_validate_config;
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,7 @@ static int test_surf_success(void) {
|
||||||
cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256;
|
cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256;
|
||||||
stub_store_init(&stub);
|
stub_store_init(&stub);
|
||||||
stub.config = cfg;
|
stub.config = cfg;
|
||||||
|
amduat_asl_store_ops_init(&ops);
|
||||||
ops.put = stub_store_put;
|
ops.put = stub_store_put;
|
||||||
ops.get = stub_store_get;
|
ops.get = stub_store_get;
|
||||||
amduat_asl_store_init(&store, cfg, ops, &stub);
|
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;
|
cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256;
|
||||||
stub_store_init(&stub);
|
stub_store_init(&stub);
|
||||||
stub.config = cfg;
|
stub.config = cfg;
|
||||||
|
amduat_asl_store_ops_init(&ops);
|
||||||
ops.put = stub_store_put;
|
ops.put = stub_store_put;
|
||||||
ops.get = stub_store_get;
|
ops.get = stub_store_get;
|
||||||
amduat_asl_store_init(&store, cfg, ops, &stub);
|
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;
|
cfg.hash_id = AMDUAT_HASH_ASL1_ID_SHA256;
|
||||||
stub_store_init(&stub);
|
stub_store_init(&stub);
|
||||||
stub.config = cfg;
|
stub.config = cfg;
|
||||||
|
amduat_asl_store_ops_init(&ops);
|
||||||
ops.put = stub_store_put;
|
ops.put = stub_store_put;
|
||||||
ops.get = stub_store_get;
|
ops.get = stub_store_get;
|
||||||
amduat_asl_store_init(&store, cfg, ops, &stub);
|
amduat_asl_store_init(&store, cfg, ops, &stub);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue