Adds regression test for autosave.

This commit is contained in:
Andrea Mazzoleni 2014-11-10 23:06:14 +01:00
parent baef69c949
commit c647e75885
5 changed files with 24 additions and 14 deletions

View file

@ -947,9 +947,11 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
}
/* autosave */
if (state->autosave != 0
if ((state->autosave != 0
&& autosavedone >= autosavelimit /* if we have reached the limit */
&& autosavemissing >= autosavelimit /* if we have at least a full step to do */
&& autosavemissing >= autosavelimit) /* if we have at least a full step to do */
/* or if we have a forced autosave at the specified block */
|| (state->opt.force_autosave_at != 0 && state->opt.force_autosave_at == i)
) {
autosavedone = 0; /* restart the counter */