fix: write data to ring buffer in test to satisfy buffer_size assertion

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-05 10:13:46 +00:00
parent 7d1b50ee82
commit 36ecb522b8

View File

@@ -107,6 +107,12 @@ void test_trigger_recording_starts_looping(void) {
// Simulate some recording // Simulate some recording
state->clips[0].write_position = 100; state->clips[0].write_position = 100;
// Write data into the ring buffer so the reducer can copy it
for (size_t i = 0; i < 100; i++) {
state->record_buffer[0][i] = (float)i;
}
atomic_store(&state->record_write_pos[0], 100);
// Trigger again to stop recording and start looping // Trigger again to stop recording and start looping
reducer(state, action); reducer(state, action);
assert(state->clips[0].state == CLIP_LOOPING); assert(state->clips[0].state == CLIP_LOOPING);