poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] testsuite: Replace `Exception` with a locally-defined struct


From: Jose E. Marchesi
Subject: Re: [PATCH] testsuite: Replace `Exception` with a locally-defined struct
Date: Tue, 30 Nov 2021 09:58:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Mohammad.

This is OK for master.
Thanks!

> This makes tests independent of `Exception` type.
>
> 2021-11-30  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
>
>       * testsuite/poke.pkl/format-21.pk: Replace `Exception` with locally
>       defined type `E`.
>       * testsuite/poke.pkl/format-22.pk: Likewise.
>       * testsuite/poke.pkl/format-23.pk: Likewise.
>       * testsuite/poke.pkl/format-24.pk: Likewise.
>       * testsuite/poke.pkl/format-25.pk: Likewise.
>       * testsuite/poke.pkl/format-26.pk: Likewise.
>       * testsuite/poke.pkl/format-27.pk: Likewise.
>       * testsuite/poke.pkl/format-28.pk: Likewise.
> ---
>  ChangeLog                       | 12 ++++++++++++
>  testsuite/poke.pkl/format-21.pk | 12 ++++++++++--
>  testsuite/poke.pkl/format-22.pk | 12 ++++++++++--
>  testsuite/poke.pkl/format-23.pk | 12 ++++++++++--
>  testsuite/poke.pkl/format-24.pk | 12 ++++++++++--
>  testsuite/poke.pkl/format-25.pk | 12 ++++++++++--
>  testsuite/poke.pkl/format-26.pk | 10 ++++++++--
>  testsuite/poke.pkl/format-27.pk | 10 ++++++++--
>  testsuite/poke.pkl/format-28.pk | 10 ++++++++--
>  9 files changed, 86 insertions(+), 16 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 106ccfeb..5e44f594 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,15 @@
> +2021-11-30  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
> +
> +     * testsuite/poke.pkl/format-21.pk: Replace `Exception` with locally
> +     defined type `E`.
> +     * testsuite/poke.pkl/format-22.pk: Likewise.
> +     * testsuite/poke.pkl/format-23.pk: Likewise.
> +     * testsuite/poke.pkl/format-24.pk: Likewise.
> +     * testsuite/poke.pkl/format-25.pk: Likewise.
> +     * testsuite/poke.pkl/format-26.pk: Likewise.
> +     * testsuite/poke.pkl/format-27.pk: Likewise.
> +     * testsuite/poke.pkl/format-28.pk: Likewise.
> +
>  2021-11-30  Jose E. Marchesi  <jemarch@gnu.org>
>  
>       * libpoke/pkl-rt-1.pk (Exception): Rename field `msg' to `name'.
> diff --git a/testsuite/poke.pkl/format-21.pk b/testsuite/poke.pkl/format-21.pk
> index a4e4ed93..c9f2bbf5 100644
> --- a/testsuite/poke.pkl/format-21.pk
> +++ b/testsuite/poke.pkl/format-21.pk
> @@ -1,5 +1,13 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
> +var e = E {code = 0, name = "generic", exit_status = 1};
> +
>  /* { dg-command {vm_set_obase (10)} } */
> -/* { dg-command {format("%v", E_generic)} } */
> -/* { dg-output {"Exception {code=0,name=\\"generic\\",exit_status=1}"} } */
> +/* { dg-command {format("%v", e)} } */
> +/* { dg-output {"E {code=0,name=\\"generic\\",exit_status=1}"} } */
> diff --git a/testsuite/poke.pkl/format-22.pk b/testsuite/poke.pkl/format-22.pk
> index 062976bf..cde198cc 100644
> --- a/testsuite/poke.pkl/format-22.pk
> +++ b/testsuite/poke.pkl/format-22.pk
> @@ -1,5 +1,13 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
> +var e = E {code = 0, name = "generic", exit_status = 1};
> +
>  /* { dg-command {vm_set_obase (10)} } */
> -/* { dg-command {format("%Fv", E_generic)} } */
> -/* { dg-output {"Exception {code=0,name=\\"generic\\",exit_status=1}"} } */
> +/* { dg-command {format("%Fv", e)} } */
> +/* { dg-output {"E {code=0,name=\\"generic\\",exit_status=1}"} } */
> diff --git a/testsuite/poke.pkl/format-23.pk b/testsuite/poke.pkl/format-23.pk
> index 6887be4b..bfb0b565 100644
> --- a/testsuite/poke.pkl/format-23.pk
> +++ b/testsuite/poke.pkl/format-23.pk
> @@ -1,5 +1,13 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
> +var e = E {code = 0, name = "generic", exit_status = 1};
> +
>  /* { dg-command {vm_set_obase (10)} } */
> -/* { dg-command {format("%Tv", E_generic)} } */
> -/* { dg-output {"Exception {\\n  code=0,\\n  name=\\"generic\\",\\n  
> exit_status=1\\n}"} } */
> +/* { dg-command {format("%Tv", e)} } */
> +/* { dg-output {"E {\\n  code=0,\\n  name=\\"generic\\",\\n  
> exit_status=1\\n}"} } */
> diff --git a/testsuite/poke.pkl/format-24.pk b/testsuite/poke.pkl/format-24.pk
> index 11a59a0a..f482311f 100644
> --- a/testsuite/poke.pkl/format-24.pk
> +++ b/testsuite/poke.pkl/format-24.pk
> @@ -1,6 +1,14 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
> +var e = E {code = 0, name = "generic", exit_status = 1};
> +
>  /* { dg-command {vm_set_obase (10)} } */
>  /* { dg-command {vm_set_oindent (4)} } */
> -/* { dg-command {format("%Tv", E_generic)} } */
> -/* { dg-output {"Exception {\\n    code=0,\\n    name=\\"generic\\",\\n    
> exit_status=1\\n}"} } */
> +/* { dg-command {format("%Tv", e)} } */
> +/* { dg-output {"E {\\n    code=0,\\n    name=\\"generic\\",\\n    
> exit_status=1\\n}"} } */
> diff --git a/testsuite/poke.pkl/format-25.pk b/testsuite/poke.pkl/format-25.pk
> index 9774a645..5c135309 100644
> --- a/testsuite/poke.pkl/format-25.pk
> +++ b/testsuite/poke.pkl/format-25.pk
> @@ -1,7 +1,15 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
> +var e = E {code = 0, name = "generic", exit_status = 1};
> +
>  /* { dg-command {vm_set_obase (16)} } */
>  /* { dg-command {vm_set_oindent (4)} } */
>  /* { dg-command {vm_set_omode (VM_OMODE_TREE)} } */  /* No effect.  */
> -/* { dg-command {format("%v", E_generic)} } */
> -/* { dg-output {"Exception 
> {code=0x00000000,name=\\"generic\\",exit_status=0x00000001}"} } */
> +/* { dg-command {format("%v", e)} } */
> +/* { dg-output {"E 
> {code=0x00000000,name=\\"generic\\",exit_status=0x00000001}"} } */
> diff --git a/testsuite/poke.pkl/format-26.pk b/testsuite/poke.pkl/format-26.pk
> index aa6abc7e..61ae63dd 100644
> --- a/testsuite/poke.pkl/format-26.pk
> +++ b/testsuite/poke.pkl/format-26.pk
> @@ -1,11 +1,17 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
>  type S = struct
>    {
> -    Exception ex;
> +    E ex;
>    };
>  
>  /* { dg-command {vm_set_obase (10)} } */
>  /* { dg-command {vm_set_odepth (1)} } */    /* No effect.  */
>  /* { dg-command {format("%v", S{})} } */
> -/* { dg-output {"S {ex=Exception {code=0,name=\\"\\",exit_status=0}}"} } */
> +/* { dg-output {"S {ex=E {code=0,name=\\"\\",exit_status=0}}"} } */
> diff --git a/testsuite/poke.pkl/format-27.pk b/testsuite/poke.pkl/format-27.pk
> index ca2b7089..7d6dafdc 100644
> --- a/testsuite/poke.pkl/format-27.pk
> +++ b/testsuite/poke.pkl/format-27.pk
> @@ -1,10 +1,16 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
>  type S = struct
>    {
> -    Exception ex;
> +    E ex;
>    };
>  
>  /* { dg-command {vm_set_obase (10)} } */
>  /* { dg-command {format("%1v", S{})} } */
> -/* { dg-output {"S {ex=Exception {...}}"} } */
> +/* { dg-output {"S {ex=E {...}}"} } */
> diff --git a/testsuite/poke.pkl/format-28.pk b/testsuite/poke.pkl/format-28.pk
> index c997f938..2be98860 100644
> --- a/testsuite/poke.pkl/format-28.pk
> +++ b/testsuite/poke.pkl/format-28.pk
> @@ -1,11 +1,17 @@
>  /* { dg-do run } */
>  
> +type E = struct
> +  {
> +    int<32> code;
> +    string name;
> +    int<32> exit_status;
> +  };
>  type S = struct
>    {
> -    Exception ex;
> +    E ex;
>    };
>  
>  /* { dg-command {vm_set_obase (10)} } */
>  /* { dg-command {vm_set_omaps (1)} } */
>  /* { dg-command {format("%1v", S{})} } */
> -/* { dg-output {S {ex=Exception {...} @ 0x0000000000000000#b @ 
> 0x0000000000000000#b} @ 0x0000000000000000#b} } */
> +/* { dg-output {S {ex=E {...} @ 0x0000000000000000#b @ 0x0000000000000000#b} 
> @ 0x0000000000000000#b} } */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]