44 - [ Using Provided Headers] ( #using-provided-headers )
55 - [ Multiple Harnesses in One Binary] ( #multiple-harnesses-in-one-binary )
66 - [ Alternative Start Harnesses] ( #alternative-start-harnesses )
7+ - [ Semi-Persistent and Fully Persistent Execution] ( #semi-persistent-and-fully-persistent-execution )
78 - [ Troubleshooting] ( #troubleshooting )
89 - [ Compile Errors About Temporaries] ( #compile-errors-about-temporaries )
910
@@ -150,11 +151,9 @@ different target software to be used with as little modification as possible.
150151
151152## Semi-Persistent and Fully Persistent Execution
152153
153- When ` snapshot_restore_interval ` is set to a value other than ` 1 ` , TSFFS does not restore
154- the initial snapshot at every iteration boundary. Instead, after ` HARNESS_STOP ` the target
155- continues executing — TSFFS writes the next testcase into the buffer and resumes from
156- immediately after ` HARNESS_STOP ` . The target harness must therefore be structured as a
157- loop:
154+ When ` snapshot_restore_interval ` is set to a value other than ` 1 ` , the snapshot is not
155+ restored at every iteration boundary. The target harness must therefore be structured as
156+ a loop, with ` HARNESS_START ` and ` HARNESS_STOP ` inside it:
158157
159158``` c
160159#include " tsffs.h"
@@ -163,26 +162,21 @@ int main() {
163162 char buffer[20];
164163 size_t size = sizeof(buffer);
165164
166- // Snapshot is taken here. TSFFS writes the first testcase into buffer and size.
167- HARNESS_START (buffer, &size);
168-
169165 while (1) {
166+ // Snapshot is taken here. TSFFS writes the testcase into buffer and size.
167+ HARNESS_START (buffer, &size);
168+
170169 function_under_test (buffer, size);
171170
172- // Signals end of iteration. TSFFS writes the next testcase into buffer
173- // and size, then resumes execution here (unless a snapshot restore occurs).
174171 HARNESS_STOP ();
175172 }
176-
177- return 0;
178173}
179174```
180175
181176For ` snapshot_restore_interval = N ` (semi-persistent), the snapshot is restored every N
182- iterations, which resets the loop back to ` HARNESS_START ` . For
183- ` snapshot_restore_interval = 0 ` (fully persistent), the snapshot is never restored and
184- the loop runs indefinitely — any per-iteration state (allocated memory, open handles,
185- etc.) must be cleaned up manually inside the loop.
177+ iterations. For ` snapshot_restore_interval = 0 ` (fully persistent), the snapshot is
178+ never restored; any per-iteration state (allocated memory, open handles, etc.) must be
179+ cleaned up manually inside the loop.
186180
187181## Troubleshooting
188182
0 commit comments