Trying to better use uncreat/zombie/orphan terms in tests

Renamed a bunch of tests:

- test_forphans_create_* -> test_forphans_uncreat_*
- test_forphans_cleanup_opened -> test_forphans_cleanup_open
- test_forphans_cleanup_orphaned -> test_forphans_cleanup_uncreat
- test_forphans_orphanzombie_fuzz -> test_forphans_uz_fuzz
- test_forphans_orphanzombiedir_fuzz -> test_forphans_uzd_fuzz
- test_*_oz_fuzz -> test_*_uz_fuzz
- test_*_ozd_fuzz -> test_*_uzd_fuzz
- test_traversal_*_orphan_* -> test_traversal_*_uncreat_*
- test_traversal_*_orphaned -> test_traversal_*_uncreat
- test_attrs_fattr_orphan -> test_attrs_fattr_uncreat

And renamed a number of variables and things.
This commit is contained in:
Christopher Haster
2024-12-29 15:29:19 -06:00
parent 7159248051
commit 18190054d9
9 changed files with 210 additions and 206 deletions
+18 -18
View File
@@ -694,8 +694,8 @@ code = '''
assert(run_ops[1]*110/100 > 2*run_ops[0]);
'''
# with orphans, zombies, etc
[cases.test_exhaustion_spam_oz_fuzz]
# with uncreats, zombies, etc
[cases.test_exhaustion_spam_uz_fuzz]
defines.ERASE_CYCLES = 10
defines.BLOCK_RECYCLES = 4
defines.BADBLOCK_BEHAVIOR = [
@@ -758,7 +758,7 @@ code = '''
typedef struct sim_file {
lfs_size_t x;
bool orphan;
bool uncreat;
bool zombie;
uint32_t prng;
lfsr_file_t file;
@@ -781,17 +781,17 @@ code = '''
lfs_size_t x = TEST_PRNG(&prng) % N;
// already exists?
bool orphan = true;
bool uncreat = true;
uint32_t wprng = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
if (sim[j] == x) {
orphan = false;
uncreat = false;
wprng = sim_prngs[j];
break;
}
}
// choose a random seed if we don't exist
if (orphan) {
if (uncreat) {
wprng = TEST_PRNG(&prng);
}
@@ -799,7 +799,7 @@ code = '''
lfs_size_t j = sim_file_count;
sim_files[j] = malloc(sizeof(sim_file_t));
sim_files[j]->x = x;
sim_files[j]->orphan = orphan;
sim_files[j]->uncreat = uncreat;
sim_files[j]->zombie = false;
sim_files[j]->prng = wprng;
@@ -815,7 +815,7 @@ code = '''
sim_file_count++;
// write some initial data if we don't exist
if (orphan) {
if (uncreat) {
uint8_t wbuf[SIZE];
for (lfs_size_t k = 0; k < SIZE; k++) {
wbuf[k] = 'a' + (TEST_PRNG(&wprng) % 26);
@@ -866,7 +866,7 @@ code = '''
// update related sim files
for (lfs_size_t k = 0; k < sim_file_count; k++) {
if (sim_files[k]->x == x && !sim_files[k]->zombie) {
sim_files[k]->orphan = false;
sim_files[k]->uncreat = false;
sim_files[k]->prng = wprng;
}
}
@@ -1116,8 +1116,8 @@ code = '''
assert(run_ops[1]*110/100 > 2*run_ops[0]);
'''
# with orphans, zombies, dirs, etc
[cases.test_exhaustion_spam_ozd_fuzz]
# with uncreats, zombies, dirs, etc
[cases.test_exhaustion_spam_uzd_fuzz]
defines.ERASE_CYCLES = 10
defines.BLOCK_RECYCLES = 4
defines.BADBLOCK_BEHAVIOR = [
@@ -1181,7 +1181,7 @@ code = '''
typedef struct sim_file {
lfs_size_t x;
bool orphan;
bool uncreat;
bool zombie;
uint32_t prng;
lfsr_file_t file;
@@ -1204,20 +1204,20 @@ code = '''
lfs_size_t x = TEST_PRNG(&prng) % N;
// already exists?
bool orphan = true;
bool uncreat = true;
uint32_t wprng = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
if (sim[j] == x) {
if (sim_isdirs[j]) {
goto nonsense;
}
orphan = false;
uncreat = false;
wprng = sim_prngs[j];
break;
}
}
// choose a random seed if we don't exist
if (orphan) {
if (uncreat) {
wprng = TEST_PRNG(&prng);
}
@@ -1225,7 +1225,7 @@ code = '''
lfs_size_t j = sim_file_count;
sim_files[j] = malloc(sizeof(sim_file_t));
sim_files[j]->x = x;
sim_files[j]->orphan = orphan;
sim_files[j]->uncreat = uncreat;
sim_files[j]->zombie = false;
sim_files[j]->prng = wprng;
@@ -1241,7 +1241,7 @@ code = '''
sim_file_count++;
// write some initial data if we don't exist
if (orphan) {
if (uncreat) {
uint8_t wbuf[SIZE];
for (lfs_size_t k = 0; k < SIZE; k++) {
wbuf[k] = 'a' + (TEST_PRNG(&wprng) % 26);
@@ -1295,7 +1295,7 @@ code = '''
// update related sim files
for (lfs_size_t k = 0; k < sim_file_count; k++) {
if (sim_files[k]->x == x && !sim_files[k]->zombie) {
sim_files[k]->orphan = false;
sim_files[k]->uncreat = false;
sim_files[k]->prng = wprng;
}
}