From 6c0112ecf20c8954ef06ad6fa24b75cb48481ebb Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Sat, 20 May 2006 01:35:27 +0000 Subject: [PATCH] * gdb.base/del.exp (test_delete_alias): New function. Now check that both "del" and "d" work as aliases for "delete". --- gdb/testsuite/ChangeLog | 5 ++++ gdb/testsuite/gdb.base/del.exp | 53 +++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c64f6b5..35809e4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-19 Joel Brobecker + + * gdb.base/del.exp (test_delete_alias): New function. + Now check that both "del" and "d" work as aliases for "delete". + 2006-05-18 Fred Fish * gdb.base/a2-run.exp: Allow part of test to run when args aren't diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp index 4d5bf47..fa0c60c 100644 --- a/gdb/testsuite/gdb.base/del.exp +++ b/gdb/testsuite/gdb.base/del.exp @@ -39,19 +39,40 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -# Test whether the "del" command works as an alias of "delete". -# For that, insert a breakpoint at an easy location, remove it, -# and then check in the output of "info break" that this breakpoint -# no longer exists. - -gdb_test "break main" \ - "Breakpoint.*at.* file .*$srcfile, line.*" \ - "breakpoint function" - -gdb_test "del \$bpnum" \ - "" \ - "Remove last breakpoint" - -gdb_test "info break" \ - "No breakpoints or watchpoints." \ - "info break after removing break on main" +# A function to test that ALIAS is working as a shortcut of the "delete" +# command. + +proc test_delete_alias { alias } { + global srcfile + + # First of all, remove all previous breakpoints if there were any, + # and then verify that we do not have any breakpoint lying around. + gdb_test "delete" \ + "" \ + "Remove all breakpoints ($alias)" + gdb_test "info break" \ + "No breakpoints or watchpoints." \ + "info break after removing break on main" + + + # Now, insert a breakpoint at an easy location, and then remove it + # using $alias. We verified that the removal worked by checking + # the list of breakpoints. + gdb_test "break main" \ + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "breakpoint insertion ($alias)" + + gdb_test "$alias \$bpnum" \ + "" \ + "Remove last breakpoint ($alias)" + + gdb_test "info break" \ + "No breakpoints or watchpoints." \ + "info break after removing break on main ($alias)" +} + +# Test various shortcut forms of the "delete" command. + +test_delete_alias "del" +test_delete_alias "d" + -- 2.7.4