119ea8026Sopenharmony_ci# These tests are for some specific corner cases with neighboring inline files.
219ea8026Sopenharmony_ci# Note that these tests are intended for 512 byte inline sizes. They should
319ea8026Sopenharmony_ci# still pass with other inline sizes but wouldn't be testing anything.
419ea8026Sopenharmony_ci
519ea8026Sopenharmony_cidefines.CACHE_SIZE = 512
619ea8026Sopenharmony_ciif = 'CACHE_SIZE % PROG_SIZE == 0 && CACHE_SIZE == 512'
719ea8026Sopenharmony_ci
819ea8026Sopenharmony_ci[cases.test_entries_grow]
919ea8026Sopenharmony_cicode = '''
1019ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
1119ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
1219ea8026Sopenharmony_ci
1319ea8026Sopenharmony_ci    lfs_t lfs;
1419ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
1519ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
1619ea8026Sopenharmony_ci
1719ea8026Sopenharmony_ci    // write hi0 20
1819ea8026Sopenharmony_ci    char path[1024];
1919ea8026Sopenharmony_ci    lfs_size_t size;
2019ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 20;
2119ea8026Sopenharmony_ci    lfs_file_t file;
2219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
2319ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
2419ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
2519ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
2619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
2719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
2819ea8026Sopenharmony_ci    // write hi1 20
2919ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
3019ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
3119ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
3219ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
3319ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
3419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
3519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
3619ea8026Sopenharmony_ci    // write hi2 20
3719ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 20;
3819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
3919ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
4019ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
4119ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
4219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
4319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
4419ea8026Sopenharmony_ci    // write hi3 20
4519ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 20;
4619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
4719ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
4819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
4919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
5019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
5119ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
5219ea8026Sopenharmony_ci
5319ea8026Sopenharmony_ci    // read hi1 20
5419ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
5519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
5619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
5719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
5819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
5919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
6019ea8026Sopenharmony_ci    // write hi1 200
6119ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
6219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
6319ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
6419ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
6519ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
6619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
6719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
6819ea8026Sopenharmony_ci
6919ea8026Sopenharmony_ci    // read hi0 20
7019ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 20;
7119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
7219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
7319ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
7419ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
7519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
7619ea8026Sopenharmony_ci    // read hi1 200
7719ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
7819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
7919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
8019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
8119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
8219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
8319ea8026Sopenharmony_ci    // read hi2 20
8419ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 20;
8519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
8619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
8719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
8819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
8919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
9019ea8026Sopenharmony_ci    // read hi3 20
9119ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 20;
9219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
9319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
9419ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
9519ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
9619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
9719ea8026Sopenharmony_ci
9819ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
9919ea8026Sopenharmony_ci'''
10019ea8026Sopenharmony_ci
10119ea8026Sopenharmony_ci[cases.test_entries_shrink]
10219ea8026Sopenharmony_cicode = '''
10319ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
10419ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
10519ea8026Sopenharmony_ci
10619ea8026Sopenharmony_ci    lfs_t lfs;
10719ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
10819ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
10919ea8026Sopenharmony_ci
11019ea8026Sopenharmony_ci    // write hi0 20
11119ea8026Sopenharmony_ci    char path[1024];
11219ea8026Sopenharmony_ci    lfs_size_t size;
11319ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 20;
11419ea8026Sopenharmony_ci    lfs_file_t file;
11519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
11619ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
11719ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
11819ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
11919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
12019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
12119ea8026Sopenharmony_ci    // write hi1 200
12219ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
12319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
12419ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
12519ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
12619ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
12719ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
12819ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
12919ea8026Sopenharmony_ci    // write hi2 20
13019ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 20;
13119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
13219ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
13319ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
13419ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
13519ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
13619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
13719ea8026Sopenharmony_ci    // write hi3 20
13819ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 20;
13919ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
14019ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
14119ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
14219ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
14319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
14419ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
14519ea8026Sopenharmony_ci
14619ea8026Sopenharmony_ci    // read hi1 200
14719ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
14819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
14919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
15019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
15119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
15219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
15319ea8026Sopenharmony_ci    // write hi1 20
15419ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
15519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
15619ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
15719ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
15819ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
15919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
16019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
16119ea8026Sopenharmony_ci
16219ea8026Sopenharmony_ci    // read hi0 20
16319ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 20;
16419ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
16519ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
16619ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
16719ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
16819ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
16919ea8026Sopenharmony_ci    // read hi1 20
17019ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
17119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
17219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
17319ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
17419ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
17519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
17619ea8026Sopenharmony_ci    // read hi2 20
17719ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 20;
17819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
17919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
18019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
18119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
18219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
18319ea8026Sopenharmony_ci    // read hi3 20
18419ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 20;
18519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
18619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
18719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
18819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
18919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
19019ea8026Sopenharmony_ci
19119ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
19219ea8026Sopenharmony_ci'''
19319ea8026Sopenharmony_ci
19419ea8026Sopenharmony_ci[cases.test_entries_spill]
19519ea8026Sopenharmony_cicode = '''
19619ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
19719ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
19819ea8026Sopenharmony_ci
19919ea8026Sopenharmony_ci    lfs_t lfs;
20019ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
20119ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
20219ea8026Sopenharmony_ci
20319ea8026Sopenharmony_ci    // write hi0 200
20419ea8026Sopenharmony_ci    char path[1024];
20519ea8026Sopenharmony_ci    lfs_size_t size;
20619ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
20719ea8026Sopenharmony_ci    lfs_file_t file;
20819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
20919ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
21019ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
21119ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
21219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
21319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
21419ea8026Sopenharmony_ci    // write hi1 200
21519ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
21619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
21719ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
21819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
21919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
22019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
22119ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
22219ea8026Sopenharmony_ci    // write hi2 200
22319ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
22419ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
22519ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
22619ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
22719ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
22819ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
22919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
23019ea8026Sopenharmony_ci    // write hi3 200
23119ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
23219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
23319ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
23419ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
23519ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
23619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
23719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
23819ea8026Sopenharmony_ci
23919ea8026Sopenharmony_ci    // read hi0 200
24019ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
24119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
24219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
24319ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
24419ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
24519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
24619ea8026Sopenharmony_ci    // read hi1 200
24719ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
24819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
24919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
25019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
25119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
25219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
25319ea8026Sopenharmony_ci    // read hi2 200
25419ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
25519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
25619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
25719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
25819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
25919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
26019ea8026Sopenharmony_ci    // read hi3 200
26119ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
26219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
26319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
26419ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
26519ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
26619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
26719ea8026Sopenharmony_ci
26819ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
26919ea8026Sopenharmony_ci'''
27019ea8026Sopenharmony_ci
27119ea8026Sopenharmony_ci[cases.test_entries_push_spill]
27219ea8026Sopenharmony_cicode = '''
27319ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
27419ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
27519ea8026Sopenharmony_ci
27619ea8026Sopenharmony_ci    lfs_t lfs;
27719ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
27819ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
27919ea8026Sopenharmony_ci
28019ea8026Sopenharmony_ci    // write hi0 200
28119ea8026Sopenharmony_ci    char path[1024];
28219ea8026Sopenharmony_ci    lfs_size_t size;
28319ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
28419ea8026Sopenharmony_ci    lfs_file_t file;
28519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
28619ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
28719ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
28819ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
28919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
29019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
29119ea8026Sopenharmony_ci    // write hi1 20
29219ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
29319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
29419ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
29519ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
29619ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
29719ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
29819ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
29919ea8026Sopenharmony_ci    // write hi2 200
30019ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
30119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
30219ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
30319ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
30419ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
30519ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
30619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
30719ea8026Sopenharmony_ci    // write hi3 200
30819ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
30919ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
31019ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
31119ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
31219ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
31319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
31419ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
31519ea8026Sopenharmony_ci
31619ea8026Sopenharmony_ci    // read hi1 20
31719ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
31819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
31919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
32019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
32119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
32219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
32319ea8026Sopenharmony_ci    // write hi1 200
32419ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
32519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
32619ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
32719ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
32819ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
32919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
33019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
33119ea8026Sopenharmony_ci
33219ea8026Sopenharmony_ci    // read hi0 200
33319ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
33419ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
33519ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
33619ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
33719ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
33819ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
33919ea8026Sopenharmony_ci    // read hi1 200
34019ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
34119ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
34219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
34319ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
34419ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
34519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
34619ea8026Sopenharmony_ci    // read hi2 200
34719ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
34819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
34919ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
35019ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
35119ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
35219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
35319ea8026Sopenharmony_ci    // read hi3 200
35419ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
35519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
35619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
35719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
35819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
35919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
36019ea8026Sopenharmony_ci
36119ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
36219ea8026Sopenharmony_ci'''
36319ea8026Sopenharmony_ci
36419ea8026Sopenharmony_ci[cases.test_entries_push_spill_two]
36519ea8026Sopenharmony_cicode = '''
36619ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
36719ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
36819ea8026Sopenharmony_ci
36919ea8026Sopenharmony_ci    lfs_t lfs;
37019ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
37119ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
37219ea8026Sopenharmony_ci
37319ea8026Sopenharmony_ci    // write hi0 200
37419ea8026Sopenharmony_ci    char path[1024];
37519ea8026Sopenharmony_ci    lfs_size_t size;
37619ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
37719ea8026Sopenharmony_ci    lfs_file_t file;
37819ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
37919ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
38019ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
38119ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
38219ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
38319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
38419ea8026Sopenharmony_ci    // write hi1 20
38519ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
38619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
38719ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
38819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
38919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
39019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
39119ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
39219ea8026Sopenharmony_ci    // write hi2 200
39319ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
39419ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
39519ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
39619ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
39719ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
39819ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
39919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
40019ea8026Sopenharmony_ci    // write hi3 200
40119ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
40219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
40319ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
40419ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
40519ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
40619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
40719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
40819ea8026Sopenharmony_ci    // write hi4 200
40919ea8026Sopenharmony_ci    sprintf(path, "hi4"); size = 200;
41019ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
41119ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
41219ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
41319ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
41419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
41519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
41619ea8026Sopenharmony_ci
41719ea8026Sopenharmony_ci    // read hi1 20
41819ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 20;
41919ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
42019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
42119ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
42219ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
42319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
42419ea8026Sopenharmony_ci    // write hi1 200
42519ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
42619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
42719ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
42819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
42919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
43019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
43119ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
43219ea8026Sopenharmony_ci
43319ea8026Sopenharmony_ci    // read hi0 200
43419ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
43519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
43619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
43719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
43819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
43919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
44019ea8026Sopenharmony_ci    // read hi1 200
44119ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
44219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
44319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
44419ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
44519ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
44619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
44719ea8026Sopenharmony_ci    // read hi2 200
44819ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
44919ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
45019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
45119ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
45219ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
45319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
45419ea8026Sopenharmony_ci    // read hi3 200
45519ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
45619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
45719ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
45819ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
45919ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
46019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
46119ea8026Sopenharmony_ci    // read hi4 200
46219ea8026Sopenharmony_ci    sprintf(path, "hi4"); size = 200;
46319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
46419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
46519ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
46619ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
46719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
46819ea8026Sopenharmony_ci
46919ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
47019ea8026Sopenharmony_ci'''
47119ea8026Sopenharmony_ci
47219ea8026Sopenharmony_ci[cases.test_entries_drop]
47319ea8026Sopenharmony_cicode = '''
47419ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
47519ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
47619ea8026Sopenharmony_ci
47719ea8026Sopenharmony_ci    lfs_t lfs;
47819ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
47919ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
48019ea8026Sopenharmony_ci
48119ea8026Sopenharmony_ci    // write hi0 200
48219ea8026Sopenharmony_ci    char path[1024];
48319ea8026Sopenharmony_ci    lfs_size_t size;
48419ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
48519ea8026Sopenharmony_ci    lfs_file_t file;
48619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
48719ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
48819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
48919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
49019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
49119ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
49219ea8026Sopenharmony_ci    // write hi1 200
49319ea8026Sopenharmony_ci    sprintf(path, "hi1"); size = 200;
49419ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
49519ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
49619ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
49719ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
49819ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
49919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
50019ea8026Sopenharmony_ci    // write hi2 200
50119ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
50219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
50319ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
50419ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
50519ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
50619ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
50719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
50819ea8026Sopenharmony_ci    // write hi3 200
50919ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
51019ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
51119ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
51219ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
51319ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
51419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
51519ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
51619ea8026Sopenharmony_ci
51719ea8026Sopenharmony_ci    lfs_remove(&lfs, "hi1") => 0;
51819ea8026Sopenharmony_ci    struct lfs_info info;
51919ea8026Sopenharmony_ci    lfs_stat(&lfs, "hi1", &info) => LFS_ERR_NOENT;
52019ea8026Sopenharmony_ci    // read hi0 200
52119ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
52219ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
52319ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
52419ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
52519ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
52619ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
52719ea8026Sopenharmony_ci    // read hi2 200
52819ea8026Sopenharmony_ci    sprintf(path, "hi2"); size = 200;
52919ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
53019ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
53119ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
53219ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
53319ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
53419ea8026Sopenharmony_ci    // read hi3 200
53519ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
53619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
53719ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
53819ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
53919ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
54019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
54119ea8026Sopenharmony_ci
54219ea8026Sopenharmony_ci    lfs_remove(&lfs, "hi2") => 0;
54319ea8026Sopenharmony_ci    lfs_stat(&lfs, "hi2", &info) => LFS_ERR_NOENT;
54419ea8026Sopenharmony_ci    // read hi0 200
54519ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
54619ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
54719ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
54819ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
54919ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
55019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
55119ea8026Sopenharmony_ci    // read hi3 200
55219ea8026Sopenharmony_ci    sprintf(path, "hi3"); size = 200;
55319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
55419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
55519ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
55619ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
55719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
55819ea8026Sopenharmony_ci
55919ea8026Sopenharmony_ci    lfs_remove(&lfs, "hi3") => 0;
56019ea8026Sopenharmony_ci    lfs_stat(&lfs, "hi3", &info) => LFS_ERR_NOENT;
56119ea8026Sopenharmony_ci    // read hi0 200
56219ea8026Sopenharmony_ci    sprintf(path, "hi0"); size = 200;
56319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
56419ea8026Sopenharmony_ci    lfs_file_size(&lfs, &file) => size;
56519ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
56619ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
56719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
56819ea8026Sopenharmony_ci
56919ea8026Sopenharmony_ci    lfs_remove(&lfs, "hi0") => 0;
57019ea8026Sopenharmony_ci    lfs_stat(&lfs, "hi0", &info) => LFS_ERR_NOENT;
57119ea8026Sopenharmony_ci
57219ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
57319ea8026Sopenharmony_ci'''
57419ea8026Sopenharmony_ci
57519ea8026Sopenharmony_ci[cases.test_entries_create_too_big]
57619ea8026Sopenharmony_cicode = '''
57719ea8026Sopenharmony_ci    lfs_t lfs;
57819ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
57919ea8026Sopenharmony_ci
58019ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
58119ea8026Sopenharmony_ci    char path[1024];
58219ea8026Sopenharmony_ci    memset(path, 'm', 200);
58319ea8026Sopenharmony_ci    path[200] = '\0';
58419ea8026Sopenharmony_ci
58519ea8026Sopenharmony_ci    lfs_size_t size = 400;
58619ea8026Sopenharmony_ci    lfs_file_t file;
58719ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
58819ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
58919ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
59019ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
59119ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
59219ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
59319ea8026Sopenharmony_ci
59419ea8026Sopenharmony_ci    size = 400;
59519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
59619ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
59719ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
59819ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
59919ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
60019ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
60119ea8026Sopenharmony_ci'''
60219ea8026Sopenharmony_ci
60319ea8026Sopenharmony_ci[cases.test_entries_resize_too_big]
60419ea8026Sopenharmony_cicode = '''
60519ea8026Sopenharmony_ci    lfs_t lfs;
60619ea8026Sopenharmony_ci    lfs_format(&lfs, cfg) => 0;
60719ea8026Sopenharmony_ci
60819ea8026Sopenharmony_ci    lfs_mount(&lfs, cfg) => 0;
60919ea8026Sopenharmony_ci    char path[1024];
61019ea8026Sopenharmony_ci    memset(path, 'm', 200);
61119ea8026Sopenharmony_ci    path[200] = '\0';
61219ea8026Sopenharmony_ci
61319ea8026Sopenharmony_ci    lfs_size_t size = 40;
61419ea8026Sopenharmony_ci    lfs_file_t file;
61519ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
61619ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
61719ea8026Sopenharmony_ci    uint8_t wbuffer[1024];
61819ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
61919ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
62019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
62119ea8026Sopenharmony_ci
62219ea8026Sopenharmony_ci    size = 40;
62319ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
62419ea8026Sopenharmony_ci    uint8_t rbuffer[1024];
62519ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
62619ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
62719ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
62819ea8026Sopenharmony_ci
62919ea8026Sopenharmony_ci    size = 400;
63019ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path,
63119ea8026Sopenharmony_ci            LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
63219ea8026Sopenharmony_ci    memset(wbuffer, 'c', size);
63319ea8026Sopenharmony_ci    lfs_file_write(&lfs, &file, wbuffer, size) => size;
63419ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
63519ea8026Sopenharmony_ci
63619ea8026Sopenharmony_ci    size = 400;
63719ea8026Sopenharmony_ci    lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
63819ea8026Sopenharmony_ci    lfs_file_read(&lfs, &file, rbuffer, size) => size;
63919ea8026Sopenharmony_ci    memcmp(rbuffer, wbuffer, size) => 0;
64019ea8026Sopenharmony_ci    lfs_file_close(&lfs, &file) => 0;
64119ea8026Sopenharmony_ci    lfs_unmount(&lfs) => 0;
64219ea8026Sopenharmony_ci'''
643