Changed TEST_PLS to track number of powerlosses seen by the current test

This turned out to have limited use for the tests themselves. I was
hoping to avoid the mount->format->mount fallback when powerloss
testing, but we still need it in case format was interrupted.

Still, TEST_PLS is very useful for debugging.

Previouly it was difficult to set a breakpoint at a specific location,
and after a specific powerloss event. Now all you need is this in gdb:

  b <line> if test_pls == <pls>
This commit is contained in:
Christopher Haster
2023-09-26 11:17:19 -05:00
parent 582dc5f1b2
commit edc4cb2fa9
4 changed files with 234 additions and 207 deletions
+4 -3
View File
@@ -72,10 +72,11 @@ extern const struct test_suite *const test_suites[];
extern const size_t test_suite_count;
// this is defined as true when powerloss-testing
extern bool test_pl;
// this variable tracks the number of powerlosses triggered during the
// current test permutation, this is useful for both tests and debugging
extern size_t test_pls;
#define TEST_PL test_pl
#define TEST_PLS test_pls
// deterministic prng for pseudo-randomness in testes
uint32_t test_prng(uint32_t *state);