Skip to content

Commit

Permalink
fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Nov 5, 2023
1 parent b6c1bae commit 360a162
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
14 changes: 8 additions & 6 deletions test/test_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,22 @@ static void test_encode_eddsa(void **state) {
int main() {
struct lfs_config cfg;
lfs_filebd_t bd;
struct lfs_filebd_config bdcfg = {.read_size = 1, .prog_size = 512, .erase_size = 512, .erase_count = 256};
bd.cfg = &bdcfg;
memset(&cfg, 0, sizeof(cfg));
cfg.context = &bd;
cfg.read = &lfs_filebd_read;
cfg.prog = &lfs_filebd_prog;
cfg.erase = &lfs_filebd_erase;
cfg.sync = &lfs_filebd_sync;
cfg.read_size = 16;
cfg.prog_size = 16;
cfg.read_size = 1;
cfg.prog_size = 512;
cfg.block_size = 512;
cfg.block_count = 400;
cfg.block_count = 256;
cfg.block_cycles = 50000;
cfg.cache_size = 128;
cfg.lookahead_size = 16;
lfs_filebd_create(&cfg, "lfs-root");
cfg.cache_size = 256;
cfg.lookahead_size = 32;
lfs_filebd_create(&cfg, "lfs-root", &bdcfg);

fs_format(&cfg);
fs_mount(&cfg);
Expand Down
14 changes: 8 additions & 6 deletions test/test_oath.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,20 +431,22 @@ static void test_space_full(void **state) {
int main() {
struct lfs_config cfg;
lfs_filebd_t bd;
struct lfs_filebd_config bdcfg = {.read_size = 1, .prog_size = 512, .erase_size = 512, .erase_count = 256};
bd.cfg = &bdcfg;
memset(&cfg, 0, sizeof(cfg));
cfg.context = &bd;
cfg.read = &lfs_filebd_read;
cfg.prog = &lfs_filebd_prog;
cfg.erase = &lfs_filebd_erase;
cfg.sync = &lfs_filebd_sync;
cfg.read_size = 16;
cfg.prog_size = 16;
cfg.read_size = 1;
cfg.prog_size = 512;
cfg.block_size = 512;
cfg.block_count = 400;
cfg.block_count = 256;
cfg.block_cycles = 50000;
cfg.cache_size = 128;
cfg.lookahead_size = 16;
lfs_filebd_create(&cfg, "lfs-root");
cfg.cache_size = 256;
cfg.lookahead_size = 32;
lfs_filebd_create(&cfg, "lfs-root", &bdcfg);

fs_format(&cfg);
fs_mount(&cfg);
Expand Down
14 changes: 8 additions & 6 deletions test/test_openpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,22 @@ static void test_special(void **state) {
int main() {
struct lfs_config cfg;
lfs_filebd_t bd;
struct lfs_filebd_config bdcfg = {.read_size = 1, .prog_size = 512, .erase_size = 512, .erase_count = 256};
bd.cfg = &bdcfg;
memset(&cfg, 0, sizeof(cfg));
cfg.context = &bd;
cfg.read = &lfs_filebd_read;
cfg.prog = &lfs_filebd_prog;
cfg.erase = &lfs_filebd_erase;
cfg.sync = &lfs_filebd_sync;
cfg.read_size = 16;
cfg.prog_size = 16;
cfg.read_size = 1;
cfg.prog_size = 512;
cfg.block_size = 512;
cfg.block_count = 400;
cfg.block_count = 256;
cfg.block_cycles = 50000;
cfg.cache_size = 128;
cfg.lookahead_size = 16;
lfs_filebd_create(&cfg, "lfs-root");
cfg.cache_size = 256;
cfg.lookahead_size = 32;
lfs_filebd_create(&cfg, "lfs-root", &bdcfg);

fs_format(&cfg);
fs_mount(&cfg);
Expand Down
14 changes: 8 additions & 6 deletions test/test_piv.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,22 @@ static void test_regression_fuzz(void **state) {
int main() {
struct lfs_config cfg;
lfs_filebd_t bd;
struct lfs_filebd_config bdcfg = {.read_size = 1, .prog_size = 512, .erase_size = 512, .erase_count = 256};
bd.cfg = &bdcfg;
memset(&cfg, 0, sizeof(cfg));
cfg.context = &bd;
cfg.read = &lfs_filebd_read;
cfg.prog = &lfs_filebd_prog;
cfg.erase = &lfs_filebd_erase;
cfg.sync = &lfs_filebd_sync;
cfg.read_size = 16;
cfg.prog_size = 16;
cfg.read_size = 1;
cfg.prog_size = 512;
cfg.block_size = 512;
cfg.block_count = 400;
cfg.block_count = 256;
cfg.block_cycles = 50000;
cfg.cache_size = 128;
cfg.lookahead_size = 16;
lfs_filebd_create(&cfg, "lfs-root");
cfg.cache_size = 256;
cfg.lookahead_size = 32;
lfs_filebd_create(&cfg, "lfs-root", &bdcfg);

fs_format(&cfg);
fs_mount(&cfg);
Expand Down

0 comments on commit 360a162

Please sign in to comment.