From 640b2a6649431fcf6f4239e6bae96711088ecf7a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 20 Feb 2022 20:34:36 +0100 Subject: [PATCH] autotest: factor out mkstate() for clarity and structural consistency. --- src/run-tests.pl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/run-tests.pl b/src/run-tests.pl index 08684db..6f56dcf 100755 --- a/src/run-tests.pl +++ b/src/run-tests.pl @@ -519,14 +519,11 @@ sub mkbox($$) } } -# \@chan_state -sub mkchan($) +# \@state +sub mkstate($) { - my ($cs) = @_; + my ($t) = @_; - my ($f, $n, $t) = @$cs; - mkbox("far", $f); - mkbox("near", $n); open(FILE, ">", "near/.mbsyncstate") or die "Cannot create sync state.\n"; print FILE "FarUidValidity 1\nMaxPulledUid ".$$t[0]."\n". @@ -537,6 +534,17 @@ sub mkchan($) close FILE; } +# \@chan_state +sub mkchan($) +{ + my ($cs) = @_; + + my ($f, $n, $t) = @$cs; + mkbox("far", $f); + mkbox("near", $n); + mkstate($t); +} + # $box_name, \@box_state sub ckbox($$) {