From 3c2dcf90b55fea84260ac83ab968c5df3b44d34d Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 16 Mar 2021 10:17:07 +0000 Subject: [PATCH] gdb/testsuite: resolve remaining duplicate test names in gdb.cp/*.exp This commit resolves the remaining duplicate test names in gdb.cp/*.exp. These are all the easy duplicates, I'm either giving tests a new, unique name, extending an existing name to make it unique, or changing an existing name to better reflect what the test is actually doing, and thus, making this test name unique. There should be no change in what is tested after this commit. gdb/testsuite/ChangeLog: * gdb.cp/breakpoint.exp: Extend test names to make them unique. * gdb.cp/casts.exp: Give tests unique names. * gdb.cp/filename.exp: Likewise. * gdb.cp/gdb2495.exp: Likewise. * gdb.cp/mb-ctor.exp: Extend test names to make them unique. * gdb.cp/misc.exp: Rename test to make it unique. * gdb.cp/nsnested.exp: Give tests unique names. * gdb.cp/ovldbreak.exp: Likewise. * gdb.cp/pr17494.exp: Rename test to reflect what is actually being tested. This also removes the duplicate test name. * gdb.cp/ref-types.exp: Likewise. * gdb.cp/temargs.exp: Likewise. --- gdb/testsuite/ChangeLog | 15 +++++++++++++++ gdb/testsuite/gdb.cp/breakpoint.exp | 8 ++++---- gdb/testsuite/gdb.cp/casts.exp | 6 ++++-- gdb/testsuite/gdb.cp/filename.exp | 6 ++++-- gdb/testsuite/gdb.cp/gdb2495.exp | 6 ++++-- gdb/testsuite/gdb.cp/mb-ctor.exp | 4 ++-- gdb/testsuite/gdb.cp/misc.exp | 2 +- gdb/testsuite/gdb.cp/nsnested.exp | 9 ++++++--- gdb/testsuite/gdb.cp/ovldbreak.exp | 6 ++++-- gdb/testsuite/gdb.cp/pr17494.exp | 2 +- gdb/testsuite/gdb.cp/ref-types.exp | 2 +- gdb/testsuite/gdb.cp/temargs.exp | 2 +- 12 files changed, 47 insertions(+), 21 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9301efe9086..d0fce5902d6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2021-03-26 Andrew Burgess + + * gdb.cp/breakpoint.exp: Extend test names to make them unique. + * gdb.cp/casts.exp: Give tests unique names. + * gdb.cp/filename.exp: Likewise. + * gdb.cp/gdb2495.exp: Likewise. + * gdb.cp/mb-ctor.exp: Extend test names to make them unique. + * gdb.cp/misc.exp: Rename test to make it unique. + * gdb.cp/nsnested.exp: Give tests unique names. + * gdb.cp/ovldbreak.exp: Likewise. + * gdb.cp/pr17494.exp: Rename test to reflect what is actually + being tested. This also removes the duplicate test name. + * gdb.cp/ref-types.exp: Likewise. + * gdb.cp/temargs.exp: Likewise. + 2021-03-26 Andrew Burgess * gdb.cp/cplusfuncs.exp (test_paddr_operator_functions): Escape diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp index 3f2e8229a2d..e98b79e5dc2 100644 --- a/gdb/testsuite/gdb.cp/breakpoint.exp +++ b/gdb/testsuite/gdb.cp/breakpoint.exp @@ -51,10 +51,10 @@ set bp_location1 [gdb_get_line_number "conditional breakpoint in method"] set bp_location2 [gdb_get_line_number "conditional breakpoint in method 2"] gdb_test "break $bp_location1 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method" gdb_test "break $bp_location2 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method 2" -gdb_test "continue" ".*Breakpoint.*C1::foo.*" "continue to breakpoint" -gdb_test "print i_" "\\\$1 = 3" "check the member variable" -gdb_test "continue" ".*Breakpoint.*C1::bar.*" "continue to breakpoint" -gdb_test "print i_" "\\\$2 = 3" "check the member variable" +gdb_test "continue" ".*Breakpoint.*C1::foo.*" "continue to breakpoint in C1::foo" +gdb_test "print i_" "\\\$1 = 3" "check the member variable from within C1::foo" +gdb_test "continue" ".*Breakpoint.*C1::bar.*" "continue to breakpoint in C1::bar" +gdb_test "print i_" "\\\$2 = 3" "check the member variable from within C1::bar" gdb_exit diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp index beb3c94ce8c..7bd879c4112 100644 --- a/gdb/testsuite/gdb.cp/casts.exp +++ b/gdb/testsuite/gdb.cp/casts.exp @@ -43,7 +43,8 @@ if ![runto_main] then { } # Prevent symbol on address 0x0 being printed. -gdb_test_no_output "set print symbol off" +gdb_test_no_output "set print symbol off" \ + "turn of symbol printing for the first time" gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \ "Breakpoint.*at.* file .*" \ @@ -184,7 +185,8 @@ if ![runto_main] then { } # Prevent symbol on address 0x0 being printed. -gdb_test_no_output "set print symbol off" +gdb_test_no_output "set print symbol off" \ + "turn of symbol printing for the second time" gdb_breakpoint [gdb_get_line_number "casts.exp: 1" $srcfile2] gdb_continue_to_breakpoint "end of casts03" diff --git a/gdb/testsuite/gdb.cp/filename.exp b/gdb/testsuite/gdb.cp/filename.exp index bf12ac6365b..3a2e9bd88bc 100644 --- a/gdb/testsuite/gdb.cp/filename.exp +++ b/gdb/testsuite/gdb.cp/filename.exp @@ -31,14 +31,16 @@ gdb_continue_to_breakpoint "stop inside C" gdb_test "print includefile\[0\]" " = 23" gdb_test "print this->includefile\[0\]" " = 23" -gdb_test "print 'includefile'::some_global" " = 27" +gdb_test "print 'includefile'::some_global" " = 27" \ + "print some_global from within C" gdb_breakpoint [gdb_get_line_number "stop inside D"] gdb_continue_to_breakpoint "stop inside D" gdb_test "print includefile()" " = 24" gdb_test "print this->includefile()" " = 24" -gdb_test "print 'includefile'::some_global" " = 27" +gdb_test "print 'includefile'::some_global" " = 27" \ + "print some_global from within D" gdb_breakpoint [gdb_get_line_number "stop outside"] gdb_continue_to_breakpoint "stop outside" diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp index a52368f12e4..5eb13ac9a90 100644 --- a/gdb/testsuite/gdb.cp/gdb2495.exp +++ b/gdb/testsuite/gdb.cp/gdb2495.exp @@ -122,7 +122,8 @@ gdb_test "show unwindonsignal" \ # Check to see if new behaviour interferes with # normal signal handling in inferior function calls. gdb_test "p exceptions.raise_signal(1)" \ - "To change this behavior use \"set unwindonsignal off\".*" + "To change this behavior use \"set unwindonsignal off\".*" \ + "check for unwindonsignal off message" # And reverse - turn off again. gdb_test_no_output "set unwindonsignal off" @@ -135,4 +136,5 @@ gdb_test "show unwindonsignal" \ # Check to see if new behaviour interferes with # normal signal handling in inferior function calls. gdb_test "p exceptions.raise_signal(1)" \ - "To change this behavior use \"set unwindonsignal on\".*" + "To change this behavior use \"set unwindonsignal on\".*" \ + "check for unwindonsignal on message" diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp index 9bbfb55ddc8..ae352adc0ce 100644 --- a/gdb/testsuite/gdb.cp/mb-ctor.exp +++ b/gdb/testsuite/gdb.cp/mb-ctor.exp @@ -51,13 +51,13 @@ gdb_test "continue" \ ".*Breakpoint.*Derived.*i=7.*" \ "run to breakpoint 1 v1" -gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here" +gdb_continue_to_breakpoint "set breakpoint here, first time" ".* breakpoint here" gdb_test "continue" \ ".*Breakpoint.*Derived.*i=15.*" \ "run to breakpoint 1 v2" -gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here" +gdb_continue_to_breakpoint "set breakpoint here, second time" ".* breakpoint here" gdb_test "continue" \ ".*Breakpoint.*~Derived.*" \ diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp index aa830312ba1..8219b23d618 100644 --- a/gdb/testsuite/gdb.cp/misc.exp +++ b/gdb/testsuite/gdb.cp/misc.exp @@ -111,6 +111,6 @@ gdb_test "print 'misc.cc'::v_bool" " = true" \ gdb_test "print *(v_bool_array + number_ref)" "\\$\[0-9\]* = false" \ "pointer addition with integer reference" gdb_test "print *(number_ref + v_bool_array)" "\\$\[0-9\]* = false" \ - "pointer addition with integer reference" + "integer reference addition with pointer" gdb_test "print *(v_bool_array - number_ref)" "\\$\[0-9\]* = false" \ "pointer subtraction with integer reference" diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp index 965deadd570..4e5bd5e5c62 100644 --- a/gdb/testsuite/gdb.cp/nsnested.exp +++ b/gdb/testsuite/gdb.cp/nsnested.exp @@ -25,17 +25,20 @@ if ![runto_main] then { continue } -gdb_test "print ab" "No symbol .* in current context." +gdb_test "print ab" "No symbol .* in current context." \ + "ensure symbol ab is not known in main" ############################################ gdb_breakpoint C::first gdb_continue_to_breakpoint "C::first" -gdb_test "print ab" "No symbol .* in current context." +gdb_test "print ab" "No symbol .* in current context." \ + "ensure symbol ab is not known in C::first" gdb_test "print C::D::ab" "= 11" ############################################ gdb_breakpoint C::D::second gdb_continue_to_breakpoint "C::D::second" -gdb_test "print ab" "= 11" +gdb_test "print ab" "= 11" \ + "ensure symbol ab is known in C::D::second" diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp index 1a61c7d0f1f..ca04d499605 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.exp +++ b/gdb/testsuite/gdb.cp/ovldbreak.exp @@ -388,13 +388,15 @@ foreach type $all_types { # is set to "cancel" gdb_test_no_output "set multiple-symbols cancel" gdb_test "break foo::foofunc" \ - "canceled.*" + "canceled.*" \ + "break on ambiguous symbol when multiple-symbols is set to cancel" # Test breaking on an overloaded function when multiple-symbols # is set to "all" gdb_test_no_output "set multiple-symbols all" gdb_test "break foo::foofunc" \ - "Breakpoint \[0-9\]+ at ${hex}: foo::foofunc. .2 locations..*" + "Breakpoint \[0-9\]+ at ${hex}: foo::foofunc. .2 locations..*" \ + "break on ambiguous symbol when multiple-symbols is set to all" # That's all, folks. diff --git a/gdb/testsuite/gdb.cp/pr17494.exp b/gdb/testsuite/gdb.cp/pr17494.exp index 127978b0084..066c4631f30 100644 --- a/gdb/testsuite/gdb.cp/pr17494.exp +++ b/gdb/testsuite/gdb.cp/pr17494.exp @@ -31,7 +31,7 @@ gdb_breakpoint [gdb_get_line_number "Break here"] gdb_continue_to_breakpoint "Break here" gdb_test "p a.geta()" ".* = 12345" "a.geta()" -gdb_test "p a_ptr->geta()" ".* = 12345" "a.geta()" +gdb_test "p a_ptr->geta()" ".* = 12345" "a_ptr->geta()" gdb_test "p false ? a.geta() : 123" ".* = 123" "ternop 1" gdb_test "p false ? a_ptr->geta() : 123" ".* = 123" "ternop 2" diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp index e38aad45731..9bd93f32602 100644 --- a/gdb/testsuite/gdb.cp/ref-types.exp +++ b/gdb/testsuite/gdb.cp/ref-types.exp @@ -242,7 +242,7 @@ gdb_test "print rI" ".\[0-9\]* = \\(int &\\) @$hex: 102" \ gdb_test "print rUI" \ ".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002" \ - "print value of UI" + "print value of rUI" gdb_test_multiple "print rL" "print value of rL" { -re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp index f372cc3f0fc..58c3c0a1cfe 100644 --- a/gdb/testsuite/gdb.cp/temargs.exp +++ b/gdb/testsuite/gdb.cp/temargs.exp @@ -136,7 +136,7 @@ gdb_test "print I" " = 91" "test value of I in func" # PR symtab/16842 - gdb used to crash here. if $have_older_template_gcc { setup_xfail "*-*-*" } -gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in templ_m" +gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in func" if $have_older_template_gcc { setup_xfail "*-*-*" } gdb_test "print P == &a_global" " = true" "test value of P in func" -- 2.30.2