[1/5] lib/tests: fix conflicting args test

Submitted by Lucas De Marchi on May 29, 2019, 11:27 p.m.

Details

Message ID 20190529232737.31515-1-lucas.demarchi@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in IGT (deprecated)

Not browsing as part of any series.

Commit Message

Lucas De Marchi May 29, 2019, 11:27 p.m.
We want to check if the long option conflicts with one from the core.
The check for conflicting short option already exists just above.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/tests/igt_conflicting_args.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/tests/igt_conflicting_args.c b/lib/tests/igt_conflicting_args.c
index c357b6c5..d8be138e 100644
--- a/lib/tests/igt_conflicting_args.c
+++ b/lib/tests/igt_conflicting_args.c
@@ -91,7 +91,7 @@  int main(int argc, char **argv)
 	internal_assert_wsignaled(do_fork(), SIGABRT);
 
 	/* conflict on long option 'val' representations */
-	long_options[0] = (struct option) { "iterations", required_argument, NULL, 0};
+	long_options[0] = (struct option) { "list-subtests", required_argument, NULL, 0};
 	short_options = "";
 	internal_assert_wsignaled(do_fork(), SIGABRT);
 

Comments

On Wed, May 29, 2019 at 04:27:33PM -0700, Lucas De Marchi wrote:
> We want to check if the long option conflicts with one from the core.
> The check for conflicting short option already exists just above.

No, this one is checking that the val (the 0) doesn't conflict.
On Fri, May 31, 2019 at 12:59:35PM +0300, Petri Latvala wrote:
>On Wed, May 29, 2019 at 04:27:33PM -0700, Lucas De Marchi wrote:
>> We want to check if the long option conflicts with one from the core.
>> The check for conflicting short option already exists just above.
>
>No, this one is checking that the val (the 0) doesn't conflict.

My point is that this check is already done above. We don't need to do
it again.

If you insist, then we will need to raise it to magic number 500,
because 0 won't be a conflict after this series.

Lucas De Marchi

>
>
>-- 
>Petri Latvala
>
>
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>  lib/tests/igt_conflicting_args.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/tests/igt_conflicting_args.c b/lib/tests/igt_conflicting_args.c
>> index c357b6c5..d8be138e 100644
>> --- a/lib/tests/igt_conflicting_args.c
>> +++ b/lib/tests/igt_conflicting_args.c
>> @@ -91,7 +91,7 @@ int main(int argc, char **argv)
>>  	internal_assert_wsignaled(do_fork(), SIGABRT);
>>
>>  	/* conflict on long option 'val' representations */
>> -	long_options[0] = (struct option) { "iterations", required_argument, NULL, 0};
>> +	long_options[0] = (struct option) { "list-subtests", required_argument, NULL, 0};
>>  	short_options = "";
>>  	internal_assert_wsignaled(do_fork(), SIGABRT);
>>
>> --
>> 2.21.0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On 6/5/19 12:38 AM, Lucas De Marchi wrote:
> On Fri, May 31, 2019 at 07:55:45AM -0700, Lucas De Marchi wrote:
>> On Fri, May 31, 2019 at 12:59:35PM +0300, Petri Latvala wrote:
>>> On Wed, May 29, 2019 at 04:27:33PM -0700, Lucas De Marchi wrote:
>>>> We want to check if the long option conflicts with one from the core.
>>>> The check for conflicting short option already exists just above.
>>>
>>> No, this one is checking that the val (the 0) doesn't conflict.
>>
>> My point is that this check is already done above. We don't need to do
>> it again.


There's two val conflict tests. One checks for conflicts against core 
short options, the latter (modified here) checks for conflicts against 
core long option values.



>>
>> If you insist, then we will need to raise it to magic number 500,
>> because 0 won't be a conflict after this series.

Yeah that would be the correct change.



Petri