Re: [PATCH v2 1/3] daemon: replace atoi() with strtoul_ui() and strtol_i()
- From
Usman Akinyemi <usmanakinyemi202@gmail.com>
- Date
- Oct 21, 2024, 13:43 UTC
- Message-ID
- <CAPSxiM_+4ZaaiyvWDVwXf3tnt08otsx=1dcJJtQsL7h59dO8kQ@mail.gmail.com>
- In-Reply-To
- <ZxZHFY4cXQ1lA4QU@pks.im>
On Mon, Oct 21, 2024 at 1:36 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 18 quoted lines
> > On Fri, Oct 18, 2024 at 01:52:58PM +0000, Usman Akinyemi via GitGitGadget wrote: > > diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh > > index c5f08b67996..c73c2196981 100755 > > --- a/t/t5570-git-daemon.sh > > +++ b/t/t5570-git-daemon.sh > > @@ -1,6 +1,6 @@ > > #!/bin/sh > > > > -test_description='test fetching over git protocol' > > +test_description='test fetching over git protocol and daemon rejects invalid options' > > GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main > > export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME > > > > Hum. I think the test description can stay as-is, as we don't typically > mention all the exact details of what we test in a test suite. But I > also don't mind this too much.
Ohh, noted. I just thought the test description does not have anything about merge.
Show 13 quoted lines
>
> > @@ -8,6 +8,31 @@ TEST_PASSES_SANITIZE_LEAK=true
> > . ./test-lib.sh
> >
> > . "$TEST_DIRECTORY"/lib-git-daemon.sh
> > +
> > +test_expect_success 'daemon rejects invalid --init-timeout values' '
> > + for arg in "3a" "-3"
> > + do
> > + test_must_fail git daemon --init-timeout="$arg" 2>actual_error &&
> > + test_write_lines "fatal: invalid init-timeout '\''$arg'\'', expecting a non-negative integer" >expected &&
>
> You can use ${SQ} instead of '\'', also for the other two tests.Will make a change now.
> > Patrick