Generated v2 prefixes

This commit is contained in:
geky-bot
2023-05-04 18:31:30 +00:00
67 changed files with 26771 additions and 5203 deletions
+59 -28
View File
@@ -2,19 +2,23 @@
# Note that these tests are intended for 512 byte inline sizes. They should
# still pass with other inline sizes but wouldn't be testing anything.
define.LFS2_CACHE_SIZE = 512
if = 'LFS2_CACHE_SIZE % LFS2_PROG_SIZE == 0 && LFS2_CACHE_SIZE == 512'
defines.CACHE_SIZE = 512
if = 'CACHE_SIZE % PROG_SIZE == 0 && CACHE_SIZE == 512'
[[case]] # entry grow test
[cases.test_entries_grow]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 20
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 20;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -94,16 +98,20 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # entry shrink test
[cases.test_entries_shrink]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 20
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 20;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -183,16 +191,20 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # entry spill test
[cases.test_entries_spill]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 200
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 200;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -256,16 +268,20 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # entry push spill test
[cases.test_entries_push_spill]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 200
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 200;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -345,16 +361,20 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # entry push spill two test
[cases.test_entries_push_spill_two]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 200
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 200;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -449,16 +469,20 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # entry drop test
[cases.test_entries_drop]
code = '''
uint8_t wbuffer[1024];
uint8_t rbuffer[1024];
lfs2_format(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
// write hi0 200
char path[1024];
lfs2_size_t size;
sprintf(path, "hi0"); size = 200;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
memset(wbuffer, 'c', size);
@@ -491,6 +515,7 @@ code = '''
lfs2_file_close(&lfs2, &file) => 0;
lfs2_remove(&lfs2, "hi1") => 0;
struct lfs2_info info;
lfs2_stat(&lfs2, "hi1", &info) => LFS2_ERR_NOENT;
// read hi0 200
sprintf(path, "hi0"); size = 200;
@@ -547,15 +572,18 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # create too big
[cases.test_entries_create_too_big]
code = '''
lfs2_format(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
char path[1024];
memset(path, 'm', 200);
path[200] = '\0';
size = 400;
lfs2_size_t size = 400;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
uint8_t wbuffer[1024];
@@ -572,15 +600,18 @@ code = '''
lfs2_unmount(&lfs2) => 0;
'''
[[case]] # resize too big
[cases.test_entries_resize_too_big]
code = '''
lfs2_format(&lfs2, &cfg) => 0;
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
lfs2_mount(&lfs2, cfg) => 0;
char path[1024];
memset(path, 'm', 200);
path[200] = '\0';
size = 40;
lfs2_size_t size = 40;
lfs2_file_t file;
lfs2_file_open(&lfs2, &file, path,
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_TRUNC) => 0;
uint8_t wbuffer[1024];