Generated v2 prefixes

This commit is contained in:
geky-bot
2024-01-23 18:48:17 +00:00
17 changed files with 455 additions and 250 deletions
+2
View File
@@ -7,6 +7,7 @@ if = 'BLOCK_CYCLES == -1'
defines.FILES = 3
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / FILES)'
defines.GC = [false, true]
defines.COMPACT_THRESH = ['-1', '0', 'BLOCK_SIZE/2']
code = '''
const char *names[] = {"bacon", "eggs", "pancakes"};
lfs2_file_t files[FILES];
@@ -60,6 +61,7 @@ code = '''
defines.FILES = 3
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / FILES)'
defines.GC = [false, true]
defines.COMPACT_THRESH = ['-1', '0', 'BLOCK_SIZE/2']
code = '''
const char *names[] = {"bacon", "eggs", "pancakes"};
+13
View File
@@ -747,6 +747,11 @@ code = '''
lfs2_file_open(&lfs2, &file, "potato",
LFS2_O_WRONLY | LFS2_O_CREAT) => LFS2_ERR_ISDIR;
lfs2_file_open(&lfs2, &file, "tacoto", LFS2_O_WRONLY | LFS2_O_CREAT) => 0;
lfs2_file_close(&lfs2, &file) => 0;
lfs2_rename(&lfs2, "tacoto", "potato") => LFS2_ERR_ISDIR;
lfs2_rename(&lfs2, "potato", "tacoto") => LFS2_ERR_NOTDIR;
lfs2_mkdir(&lfs2, "/") => LFS2_ERR_EXIST;
lfs2_file_open(&lfs2, &file, "/",
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_EXCL) => LFS2_ERR_EXIST;
@@ -770,6 +775,10 @@ code = '''
lfs2_dir_read(&lfs2, &dir, &info) => 1;
assert(info.type == LFS2_TYPE_DIR);
assert(strcmp(info.name, "potato") == 0);
lfs2_dir_read(&lfs2, &dir, &info) => 1;
assert(info.type == LFS2_TYPE_REG);
assert(strcmp(info.name, "tacoto") == 0);
assert(info.size == 0);
lfs2_dir_read(&lfs2, &dir, &info) => 0;
lfs2_dir_close(&lfs2, &dir) => 0;
@@ -790,6 +799,10 @@ code = '''
lfs2_dir_read(&lfs2, &dir, &info) => 1;
assert(info.type == LFS2_TYPE_DIR);
assert(strcmp(info.name, "potato") == 0);
lfs2_dir_read(&lfs2, &dir, &info) => 1;
assert(info.type == LFS2_TYPE_REG);
assert(strcmp(info.name, "tacoto") == 0);
assert(info.size == 0);
lfs2_dir_read(&lfs2, &dir, &info) => 0;
lfs2_dir_close(&lfs2, &dir) => 0;
lfs2_unmount(&lfs2) => 0;
+18 -3
View File
@@ -1,5 +1,6 @@
[cases.test_files_simple]
defines.INLINE_MAX = [0, -1, 8]
code = '''
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
@@ -25,6 +26,7 @@ code = '''
[cases.test_files_large]
defines.SIZE = [32, 8192, 262144, 0, 7, 8193]
defines.CHUNKSIZE = [31, 16, 33, 1, 1023]
defines.INLINE_MAX = [0, -1, 8]
code = '''
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
@@ -67,6 +69,7 @@ code = '''
defines.SIZE1 = [32, 8192, 131072, 0, 7, 8193]
defines.SIZE2 = [32, 8192, 131072, 0, 7, 8193]
defines.CHUNKSIZE = [31, 16, 1]
defines.INLINE_MAX = [0, -1, 8]
code = '''
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
@@ -152,6 +155,7 @@ code = '''
defines.SIZE1 = [32, 8192, 131072, 0, 7, 8193]
defines.SIZE2 = [32, 8192, 131072, 0, 7, 8193]
defines.CHUNKSIZE = [31, 16, 1]
defines.INLINE_MAX = [0, -1, 8]
code = '''
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
@@ -232,6 +236,7 @@ code = '''
defines.SIZE1 = [32, 8192, 131072, 0, 7, 8193]
defines.SIZE2 = [32, 8192, 131072, 0, 7, 8193]
defines.CHUNKSIZE = [31, 16, 1]
defines.INLINE_MAX = [0, -1, 8]
code = '''
lfs2_t lfs2;
lfs2_format(&lfs2, cfg) => 0;
@@ -303,6 +308,7 @@ code = '''
[cases.test_files_reentrant_write]
defines.SIZE = [32, 0, 7, 2049]
defines.CHUNKSIZE = [31, 16, 65]
defines.INLINE_MAX = [0, -1, 8]
reentrant = true
code = '''
lfs2_t lfs2;
@@ -354,11 +360,20 @@ code = '''
[cases.test_files_reentrant_write_sync]
defines = [
# append (O(n))
{MODE='LFS2_O_APPEND', SIZE=[32, 0, 7, 2049], CHUNKSIZE=[31, 16, 65]},
{MODE='LFS2_O_APPEND',
SIZE=[32, 0, 7, 2049],
CHUNKSIZE=[31, 16, 65],
INLINE_MAX=[0, -1, 8]},
# truncate (O(n^2))
{MODE='LFS2_O_TRUNC', SIZE=[32, 0, 7, 200], CHUNKSIZE=[31, 16, 65]},
{MODE='LFS2_O_TRUNC',
SIZE=[32, 0, 7, 200],
CHUNKSIZE=[31, 16, 65],
INLINE_MAX=[0, -1, 8]},
# rewrite (O(n^2))
{MODE=0, SIZE=[32, 0, 7, 200], CHUNKSIZE=[31, 16, 65]},
{MODE=0,
SIZE=[32, 0, 7, 200],
CHUNKSIZE=[31, 16, 65],
INLINE_MAX=[0, -1, 8]},
]
reentrant = true
code = '''
+2 -2
View File
@@ -98,7 +98,7 @@ code = '''
lfs2_mount(&lfs2, cfg) => 0;
// create an orphan
lfs2_mdir_t orphan;
lfs2_alloc_ack(&lfs2);
lfs2_alloc_ckpoint(&lfs2);
lfs2_dir_alloc(&lfs2, &orphan) => 0;
lfs2_dir_commit(&lfs2, &orphan, NULL, 0) => 0;
@@ -170,7 +170,7 @@ code = '''
lfs2_mount(&lfs2, cfg) => 0;
// create an orphan
lfs2_mdir_t orphan;
lfs2_alloc_ack(&lfs2);
lfs2_alloc_ckpoint(&lfs2);
lfs2_dir_alloc(&lfs2, &orphan) => 0;
lfs2_dir_commit(&lfs2, &orphan, NULL, 0) => 0;