Generated v2 prefixes
This commit is contained in:
+26
-8
@@ -6,6 +6,7 @@ if = 'BLOCK_CYCLES == -1'
|
||||
[cases.test_alloc_parallel]
|
||||
defines.FILES = 3
|
||||
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / FILES)'
|
||||
defines.GC = [false, true]
|
||||
code = '''
|
||||
const char *names[] = {"bacon", "eggs", "pancakes"};
|
||||
lfs2_file_t files[FILES];
|
||||
@@ -24,6 +25,9 @@ code = '''
|
||||
LFS2_O_WRONLY | LFS2_O_CREAT | LFS2_O_APPEND) => 0;
|
||||
}
|
||||
for (int n = 0; n < FILES; n++) {
|
||||
if (GC) {
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
}
|
||||
size_t size = strlen(names[n]);
|
||||
for (lfs2_size_t i = 0; i < SIZE; i += size) {
|
||||
lfs2_file_write(&lfs2, &files[n], names[n], size) => size;
|
||||
@@ -55,6 +59,7 @@ code = '''
|
||||
[cases.test_alloc_serial]
|
||||
defines.FILES = 3
|
||||
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / FILES)'
|
||||
defines.GC = [false, true]
|
||||
code = '''
|
||||
const char *names[] = {"bacon", "eggs", "pancakes"};
|
||||
|
||||
@@ -75,6 +80,9 @@ code = '''
|
||||
uint8_t buffer[1024];
|
||||
memcpy(buffer, names[n], size);
|
||||
for (int i = 0; i < SIZE; i += size) {
|
||||
if (GC) {
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
}
|
||||
lfs2_file_write(&lfs2, &file, buffer, size) => size;
|
||||
}
|
||||
lfs2_file_close(&lfs2, &file) => 0;
|
||||
@@ -247,6 +255,9 @@ code = '''
|
||||
}
|
||||
res => LFS2_ERR_NOSPC;
|
||||
|
||||
// note that lfs2_fs_gc should not error here
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
|
||||
lfs2_file_close(&lfs2, &file) => 0;
|
||||
lfs2_unmount(&lfs2) => 0;
|
||||
|
||||
@@ -298,6 +309,9 @@ code = '''
|
||||
}
|
||||
res => LFS2_ERR_NOSPC;
|
||||
|
||||
// note that lfs2_fs_gc should not error here
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
|
||||
lfs2_file_close(&lfs2, &file) => 0;
|
||||
lfs2_unmount(&lfs2) => 0;
|
||||
|
||||
@@ -337,6 +351,8 @@ code = '''
|
||||
count += 1;
|
||||
}
|
||||
err => LFS2_ERR_NOSPC;
|
||||
// note that lfs2_fs_gc should not error here
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
lfs2_file_close(&lfs2, &file) => 0;
|
||||
|
||||
lfs2_remove(&lfs2, "exhaustion") => 0;
|
||||
@@ -435,6 +451,8 @@ code = '''
|
||||
break;
|
||||
}
|
||||
}
|
||||
// note that lfs2_fs_gc should not error here
|
||||
lfs2_fs_gc(&lfs2) => 0;
|
||||
lfs2_file_close(&lfs2, &file) => 0;
|
||||
|
||||
lfs2_unmount(&lfs2) => 0;
|
||||
@@ -460,8 +478,8 @@ code = '''
|
||||
|
||||
# chained dir exhaustion test
|
||||
[cases.test_alloc_chained_dir_exhaustion]
|
||||
if = 'BLOCK_SIZE == 512'
|
||||
defines.BLOCK_COUNT = 1024
|
||||
if = 'ERASE_SIZE == 512'
|
||||
defines.ERASE_COUNT = 1024
|
||||
code = '''
|
||||
lfs2_t lfs2;
|
||||
lfs2_format(&lfs2, cfg) => 0;
|
||||
@@ -538,8 +556,8 @@ code = '''
|
||||
|
||||
# split dir test
|
||||
[cases.test_alloc_split_dir]
|
||||
if = 'BLOCK_SIZE == 512'
|
||||
defines.BLOCK_COUNT = 1024
|
||||
if = 'ERASE_SIZE == 512'
|
||||
defines.ERASE_COUNT = 1024
|
||||
code = '''
|
||||
lfs2_t lfs2;
|
||||
lfs2_format(&lfs2, cfg) => 0;
|
||||
@@ -587,8 +605,8 @@ code = '''
|
||||
|
||||
# outdated lookahead test
|
||||
[cases.test_alloc_outdated_lookahead]
|
||||
if = 'BLOCK_SIZE == 512'
|
||||
defines.BLOCK_COUNT = 1024
|
||||
if = 'ERASE_SIZE == 512'
|
||||
defines.ERASE_COUNT = 1024
|
||||
code = '''
|
||||
lfs2_t lfs2;
|
||||
lfs2_format(&lfs2, cfg) => 0;
|
||||
@@ -655,8 +673,8 @@ code = '''
|
||||
|
||||
# outdated lookahead and split dir test
|
||||
[cases.test_alloc_outdated_lookahead_split_dir]
|
||||
if = 'BLOCK_SIZE == 512'
|
||||
defines.BLOCK_COUNT = 1024
|
||||
if = 'ERASE_SIZE == 512'
|
||||
defines.ERASE_COUNT = 1024
|
||||
code = '''
|
||||
lfs2_t lfs2;
|
||||
lfs2_format(&lfs2, cfg) => 0;
|
||||
|
||||
Reference in New Issue
Block a user