public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix duplicate in gdb.mi/mi-var-cp.exp
@ 2021-10-25 16:14 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-10-25 16:14 UTC (permalink / raw)
  To: gdb-patches

With test-case gdb.mi/mi-var-cp.exp I run into this duplicate:
...
PASS: gdb.mi/mi-var-cp.exp: run to mi-var-cp.cc:104 (set breakpoint)
PASS: gdb.mi/mi-var-cp.exp: create varobj for s
PASS: gdb.mi/mi-var-cp.exp: create varobj for s
DUPLICATE: gdb.mi/mi-var-cp.exp: create varobj for s
...

This is due to a duplicate test name here:
...
$ cat -n gdb/testsuite/gdb.mi/mi-var-cp.cc
  ...
   100  int reference_to_struct ()
   101  {
   102    /*: BEGIN: reference_to_struct :*/
   103    S s = {7, 8};
   104    S& r = s;
   105    /*:
   106      mi_create_varobj S s "create varobj for s"
   107      mi_create_varobj R r "create varobj for s"
...

Fix this by using "create varobj for r" instead.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.mi/mi-var-cp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc
index 43323c49e60..0d4cd7b741d 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.cc
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc
@@ -104,7 +104,7 @@ int reference_to_struct ()
   S& r = s;
   /*:
     mi_create_varobj S s "create varobj for s"
-    mi_create_varobj R r "create varobj for s"
+    mi_create_varobj R r "create varobj for r"
     mi_gdb_test "-var-show-attributes S" \
 	"\\^done,attr=\"noneditable\"" \
 	"check attributes of S"

base-commit: eb5323fdf88aff59afca0a545877c4d777ff2726
-- 
2.26.2


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

only message in thread, other threads:[~2021-10-25 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 16:14 [pushed] [gdb/testsuite] Fix duplicate in gdb.mi/mi-var-cp.exp Tom de Vries

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