public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Fei Jie <feij.fnst@cn.fujitsu.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3 2/4] Add testcases to display.exp
Date: Sun, 06 Dec 2015 14:00:00 -0000	[thread overview]
Message-ID: <20151206140013.GE10969@adacore.com> (raw)
In-Reply-To: <1447142188-20759-3-git-send-email-feij.fnst@cn.fujitsu.com>

On Tue, Nov 10, 2015 at 03:56:26PM +0800, Fei Jie wrote:
>     add testcases to display different types of data and variables
>     *display/d/u/o/t/a/c
>     *display array and structure

Same as for patch #1, no identation and capital 'A' for "Add".
Also, would you mind adding a space after the '*' for each bullet point?
I think this is going to make the revision log more readable.

> gdb/testsuite/ChangeLog:
> 
>     * gdb.base/display.c: Add varaible types.

typo: "varaible" -> "variable". But the sentence is malformed, since
it says you're adding types, which is not the case; you are adding
varaibles. I would be more precise, to help readers of the
ChangeLog entry, and say:

        * gdb.base/display.c: Add integer array varaible.  Add struct
        variable.

>     * gdb.base/display.exp: Add testcases to test display.

"Add additional tests of the display command."

> ---
>  gdb/testsuite/gdb.base/display.c   |  6 ++++++
>  gdb/testsuite/gdb.base/display.exp | 17 ++++++++++++++---
>  2 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c
> index cd833e2..2ade4d7 100644
> --- a/gdb/testsuite/gdb.base/display.c
> +++ b/gdb/testsuite/gdb.base/display.c
> @@ -4,6 +4,12 @@
>  #define LOOP 10
>  
>  int sum = 0;
> +int int_array[2] = {0, 1};
> +struct
> +  {
> +	char name;
> +	int age;
> +  } human;

The formatting does not conform to the GNU Coding Standards. It should
be:

struct
{
  char name;
  int age;
} human;

>  
>  /* Call to force a variable onto the stack so we can see its address.  */
>  void force_mem (int *arg) { }
> diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
> index 6e21d9e..8cbf875 100644
> --- a/gdb/testsuite/gdb.base/display.exp
> +++ b/gdb/testsuite/gdb.base/display.exp
> @@ -80,13 +80,24 @@ gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
>  gdb_test "disp/i &k" ".*3: x/i &k(\r\n|  )   $hex:.*" "display &k"
>  gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f"
>  gdb_test "disp/s &sum" ".*5: x/s &sum  $hex.*sum.:.*" "display/s &sum"
> +gdb_test "disp/d f" "6: /d f = 3" "display/d f"
> +gdb_test "disp/u f" "7: /u f = 3" "display/u f"
> +gdb_test "disp/o f" "8: /o f = 03" "display/o f"
> +gdb_test "disp/t f" "9: /t f = 11" "display/t f"
> +gdb_test "disp/a f" "10: /a f = 0x3" "display/a f"
> +gdb_test "disp/c f" "11: /c f = 3\ \'\\\\003\'" "display/c f"
> +
> +gdb_test "disp int_array" \
> +    "12: int_array = \\{0, 1\\}" "display array"
> +gdb_test "disp human" \
> +    "13: human = {name = 0 '\\\\000', age = 0}" "display struct"
>  
>  # Hit the displays
>  #
> -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
> -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
> +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 3 \'\\\\003\'\r\n\[0-9\]*: /a f = 0x3\r\n\[1-9\]*: /t f = 11\r\n\[1-9\]*: /o f = 03\r\n\[1-9\]*: /u f = 3\r\n\[1-9\]*: /d f = 3\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
> +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 4 \'\\\\004\'\r\n\[0-9\]*: /a f = 0x4\r\n\[1-9\]*: /t f = 100\r\n\[1-9\]*: /o f = 04\r\n\[1-9\]*: /u f = 4\r\n\[1-9\]*: /d f = 4\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "second disp"

Do you think the tests above could be made more readable by using
the multi_line function?

-- 
Joel

  reply	other threads:[~2015-12-06 14:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  7:56 [PATCH v3 0/4] Add some testcases Fei Jie
2015-11-10  7:57 ` [PATCH v3 4/4] Add testcases to break.exp Fei Jie
2015-12-06 14:10   ` Joel Brobecker
2015-11-10  7:57 ` [PATCH v3 2/4] Add testcases to display.exp Fei Jie
2015-12-06 14:00   ` Joel Brobecker [this message]
2015-11-10  7:57 ` [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Fei Jie
2015-12-06 14:08   ` Joel Brobecker
2015-11-10  7:57 ` [PATCH v3 1/4] Add testcases to default.exp Fei Jie
2015-12-06 13:51   ` Joel Brobecker
2015-11-10  8:02 ` [PATCH v3 0/4] Add some testcases fj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151206140013.GE10969@adacore.com \
    --to=brobecker@adacore.com \
    --cc=feij.fnst@cn.fujitsu.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).