public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp
Date: Thu, 26 Jan 2023 20:22:37 +0000 (GMT)	[thread overview]
Message-ID: <20230126202237.D2F8C385842C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5dd4f3585df57662e4b77d2b22223ba40395943c

commit 5dd4f3585df57662e4b77d2b22223ba40395943c
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Fri Jan 6 10:07:21 2023 -0500

    gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp
    
    Use gdb_assert instead of manual pass/fail.
    
    Change-Id: I71fbc4e37a0a1ef4783056c7424e932651fa397f

Diff:
---
 gdb/testsuite/gdb.dap/basic-dap.exp | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.dap/basic-dap.exp b/gdb/testsuite/gdb.dap/basic-dap.exp
index d3acf0c22c8..c60989d2a6f 100644
--- a/gdb/testsuite/gdb.dap/basic-dap.exp
+++ b/gdb/testsuite/gdb.dap/basic-dap.exp
@@ -75,12 +75,7 @@ set obj [dap_check_request_and_response "reset breakpoint by line number" \
 	     [format {o source [o path [%s]] breakpoints [a [o line [i %d]]]} \
 		  [list s $srcfile] $line]]
 set new_line_bpno [dap_get_breakpoint_number $obj]
-
-if {$new_line_bpno == $line_bpno} {
-    pass "re-setting kept same breakpoint number"
-} else {
-    fail "re-setting kept same breakpoint number"
-}
+gdb_assert {$new_line_bpno == $line_bpno} "re-setting kept same breakpoint number"
 
 # This uses "&address_breakpoint_here" as the address -- this is a
 # hack because we know how this is implemented under the hood.
@@ -131,21 +126,13 @@ dap_match_values "global value in main" [lindex $obj 0] \
 set obj [dap_request_and_response "evaluate non-existing variable" \
 	     evaluate {o expression [s nosuchvariable]}]
 set d [namespace eval ton::2dict [lindex $obj 0]]
-if {[dict get $d success] == "false"} {
-    pass "result of invalid request"
-} else {
-    fail "result of invalid request"
-}
+gdb_assert { [dict get $d success] == "false" } "result of invalid request"
 
 set obj [dap_check_request_and_response "disassemble one instruction" \
 	     disassemble \
 	     [format {o memoryReference [s %s] instructionCount [i 1]} \
 		  $insn_pc]]
 set d [namespace eval ton::2dict [lindex $obj 0]]
-if {[dict exists $d body instructions]} {
-    pass "instructions in disassemble output"
-} else {
-    fail "instructions in disassemble output"
-}
+gdb_assert { [dict exists $d body instructions] } "instructions in disassemble output"
 
 dap_shutdown

                 reply	other threads:[~2023-01-26 20:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230126202237.D2F8C385842C@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@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).