Re: [PATCH v9 1/3] parse-options.c: make OPTION__COUNTUP consider negative values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> A couple of new tests to t0040-parse-options.sh would be great to
> ensure that starting from a negative value works as advertised, i.e.
> at least that '--option' jumps to 1 and '--no-option' resets to 0.

I think adding tests to t0040-parse-options.sh cannot reflect the
behavior introduced by this patch.
This is because setting the initial value of the variable (which is
going to be modified by the argument) is set in test-parse-options.c .
A possible solution will be to modify the test-parse-options.c and
initialize the required variable (verbose or quiet) to "unspecified"
value. But then this will leave one part of the untested ie. when the
initial value of the variable is 0. I could do one thing to test these
both behaviors which is to set verbose initially to -1 and leave quiet
= 0. Since verbose and quiet are both consumers of OPT_COUNTUP, this
can test both the behaviors.

I tried searching for alternatives but could not find any. Is there
something else which you had thought before that would test this
behavior?

If not, then we are left with 2 options, either modify
test-parse-options.c or just hand test it whenever there seems to be a
problematic case.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]