diff mbox series

tst-spawn-cgroup.c: Fix argument order of UNSUPPORTED message.

Message ID 20231019123559.3922193-1-stli@linux.ibm.com
State New
Headers show
Series tst-spawn-cgroup.c: Fix argument order of UNSUPPORTED message. | expand

Commit Message

Stefan Liebler Oct. 19, 2023, 12:35 p.m. UTC
The arguments for "expected" and "got" are mismatched.  Furthermore
this patch is dumping both values as hex.
---
 sysdeps/unix/sysv/linux/tst-spawn-cgroup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Adhemerval Zanella Netto Oct. 19, 2023, 1:36 p.m. UTC | #1
On 19/10/23 09:35, Stefan Liebler wrote:
> The arguments for "expected" and "got" are mismatched.  Furthermore
> this patch is dumping both values as hex.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/tst-spawn-cgroup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> index 84e24696eb..a9843aeb89 100644
> --- a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> +++ b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> @@ -136,9 +136,9 @@ create_new_cgroup (char **newcgroup)
>      }
>  
>    if (!F_TYPE_EQUAL (fs.f_type, CGROUP2_SUPER_MAGIC))
> -    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected %jx, got %jd)",
> -		      CGROUPFS, (intmax_t) fs.f_type,
> -		      (intmax_t) CGROUP2_SUPER_MAGIC);
> +    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected 0x%jx, got 0x%jx)",

You can use %#jx instead.

> +		      CGROUPFS, (intmax_t) CGROUP2_SUPER_MAGIC,
> +		      (intmax_t) fs.f_type);
>  
>    char *cgroup = get_cgroup ();
>    TEST_VERIFY_EXIT (cgroup != NULL);
Florian Weimer Oct. 19, 2023, 1:39 p.m. UTC | #2
* Stefan Liebler:

> The arguments for "expected" and "got" are mismatched.  Furthermore
> this patch is dumping both values as hex.
> ---
>  sysdeps/unix/sysv/linux/tst-spawn-cgroup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> index 84e24696eb..a9843aeb89 100644
> --- a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> +++ b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
> @@ -136,9 +136,9 @@ create_new_cgroup (char **newcgroup)
>      }
>  
>    if (!F_TYPE_EQUAL (fs.f_type, CGROUP2_SUPER_MAGIC))
> -    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected %jx, got %jd)",
> -		      CGROUPFS, (intmax_t) fs.f_type,
> -		      (intmax_t) CGROUP2_SUPER_MAGIC);
> +    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected 0x%jx, got 0x%jx)",
> +		      CGROUPFS, (intmax_t) CGROUP2_SUPER_MAGIC,
> +		      (intmax_t) fs.f_type);
>  
>    char *cgroup = get_cgroup ();
>    TEST_VERIFY_EXIT (cgroup != NULL);

Looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian
Stefan Liebler Oct. 20, 2023, 6:48 a.m. UTC | #3
On 19.10.23 15:36, Adhemerval Zanella Netto wrote:
> 
> 
> On 19/10/23 09:35, Stefan Liebler wrote:
>> The arguments for "expected" and "got" are mismatched.  Furthermore
>> this patch is dumping both values as hex.
> 
> LGTM, thanks.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
>> ---
>>  sysdeps/unix/sysv/linux/tst-spawn-cgroup.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
>> index 84e24696eb..a9843aeb89 100644
>> --- a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
>> +++ b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
>> @@ -136,9 +136,9 @@ create_new_cgroup (char **newcgroup)
>>      }
>>  
>>    if (!F_TYPE_EQUAL (fs.f_type, CGROUP2_SUPER_MAGIC))
>> -    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected %jx, got %jd)",
>> -		      CGROUPFS, (intmax_t) fs.f_type,
>> -		      (intmax_t) CGROUP2_SUPER_MAGIC);
>> +    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected 0x%jx, got 0x%jx)",
> 
> You can use %#jx instead.
> 
Thanks Adhemerval, Florian for your review.
I've just committed it with %#jx.

Bye
Stefan
>> +		      CGROUPFS, (intmax_t) CGROUP2_SUPER_MAGIC,
>> +		      (intmax_t) fs.f_type);
>>  
>>    char *cgroup = get_cgroup ();
>>    TEST_VERIFY_EXIT (cgroup != NULL);
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
index 84e24696eb..a9843aeb89 100644
--- a/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
+++ b/sysdeps/unix/sysv/linux/tst-spawn-cgroup.c
@@ -136,9 +136,9 @@  create_new_cgroup (char **newcgroup)
     }
 
   if (!F_TYPE_EQUAL (fs.f_type, CGROUP2_SUPER_MAGIC))
-    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected %jx, got %jd)",
-		      CGROUPFS, (intmax_t) fs.f_type,
-		      (intmax_t) CGROUP2_SUPER_MAGIC);
+    FAIL_UNSUPPORTED ("%s is not a cgroupv2 (expected 0x%jx, got 0x%jx)",
+		      CGROUPFS, (intmax_t) CGROUP2_SUPER_MAGIC,
+		      (intmax_t) fs.f_type);
 
   char *cgroup = get_cgroup ();
   TEST_VERIFY_EXIT (cgroup != NULL);