public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Minor cleanup in ada-nested.exp
@ 2023-11-15 14:51 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-11-15 14:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes ada-nested.exp to fix a test name (the test expects three
variables but is named "two"), and to iterate over all the variables
that are found -- that way, if we get an unexpected one, there will be
a record of it.
---
 gdb/testsuite/gdb.dap/ada-nested.exp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.dap/ada-nested.exp b/gdb/testsuite/gdb.dap/ada-nested.exp
index 1a02f4f352e..00d3275a34c 100644
--- a/gdb/testsuite/gdb.dap/ada-nested.exp
+++ b/gdb/testsuite/gdb.dap/ada-nested.exp
@@ -60,13 +60,14 @@ lassign $scopes args locals _ignore
 gdb_assert {[dict get $args name] == "Arguments"} "argument scope"
 gdb_assert {[dict get $locals name] == "Locals"} "local scope"
 
-gdb_assert {[dict get $locals namedVariables] == 3} "two locals"
+set num_vars [dict get $locals namedVariables]
+gdb_assert {$num_vars == 3} "three locals"
 
 set num [dict get $locals variablesReference]
 set refs [lindex [dap_check_request_and_response "fetch variables" \
 		      "variables" \
-		      [format {o variablesReference [i %d] count [i 3]} \
-			   $num]] \
+		      [format {o variablesReference [i %d] count [i %d]} \
+			   $num $num_vars]] \
 	      0]
 
 foreach var [dict get $refs body variables] {
-- 
2.41.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-15 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 14:51 [PATCH] Minor cleanup in ada-nested.exp Tom Tromey

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).