From a59f104ed89fc57cfc877f863ffff7a9afd6d3f9 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Wed, 15 Mar 1995 21:23:14 +0000 Subject: [PATCH] * gdb.base/printcmds.exp (test_character_literals_accepted): Test printing of '\'' (which is what the comment says we are testing, even though we were not), not '''. (test_integer_literals_rejected): Test that printing ''' is an error. * gdb.fortran/exprs.exp, gdb.fortran/types.exp, gdb.chill/chexp.exp, gdb.base/printcmds.exp, gdb.c++/cplusfuncs.exp, gdb.chill/callch.exp, gdb.chill/misc.exp, gdb.chill/pr-6292.exp, gdb.chill/string.exp, gdb.chill/tuples.exp: Use gdb_test not test_print_accept. * lib/gdb.exp: Remove test_print_accept. --- gdb/testsuite/ChangeLog | 12 + gdb/testsuite/gdb.chill/callch.exp | 4 +- gdb/testsuite/gdb.chill/chexp.exp | 344 ++++++++++++++-------------- gdb/testsuite/gdb.chill/misc.exp | 14 +- gdb/testsuite/gdb.chill/pr-6292.exp | 2 +- gdb/testsuite/gdb.chill/string.exp | 16 +- gdb/testsuite/gdb.chill/tuples.exp | 4 +- gdb/testsuite/lib/gdb.exp | 59 +---- 8 files changed, 205 insertions(+), 250 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4ee73127be7..2139532ba98 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,17 @@ Wed Mar 15 04:11:14 1995 Jim Kingdon (kingdon@lioth.cygnus.com) + * gdb.base/printcmds.exp (test_character_literals_accepted): Test + printing of '\'' (which is what the comment says we are testing, + even though we were not), not '''. + (test_integer_literals_rejected): Test that printing ''' is an error. + + * gdb.fortran/exprs.exp, gdb.fortran/types.exp, + gdb.chill/chexp.exp, gdb.base/printcmds.exp, + gdb.c++/cplusfuncs.exp, gdb.chill/callch.exp, gdb.chill/misc.exp, + gdb.chill/pr-6292.exp, gdb.chill/string.exp, gdb.chill/tuples.exp: + Use gdb_test not test_print_accept. + * lib/gdb.exp: Remove test_print_accept. + * gdb.base/signals.exp (signal_tests_1): Make pass message consistent with fail message. diff --git a/gdb/testsuite/gdb.chill/callch.exp b/gdb/testsuite/gdb.chill/callch.exp index 3f4541b5d7b..1b05713115f 100644 --- a/gdb/testsuite/gdb.chill/callch.exp +++ b/gdb/testsuite/gdb.chill/callch.exp @@ -45,10 +45,10 @@ proc do_tests {} { gdb_test_exact "call fred()" {too few arguments in function call} # Too many arguments are allowed gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.} - test_print_accept "print a" {\[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\ + gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\ "print a before king" gdb_test {call king(a, otto[[10, 15], [20, 25]])} "x\\(FALSE, FALSE\\) = 10.*p\\(FALSE, FALSE\\) = -1.*x\\(FALSE, TRUE\\) = 15.*p\\(FALSE, TRUE\\) = -1.*x\\(TRUE, FALSE\\) = 20.*p\\(TRUE, FALSE\\) = -1.*x\\(TRUE, TRUE\\) = 25.*p\\(TRUE, TRUE\\) = -1.*" - test_print_accept "print a" {\[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\ + gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\ "print a after king" gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.} gdb_test "call whitney(c)" "x.f1\\(FALSE, FALSE\\) = 1.*x.f1\\(FALSE, TRUE\\) = 1.*x.f1\\(TRUE, FALSE\\) = 1.*x.f1\\(TRUE, TRUE\\) = 1.*" diff --git a/gdb/testsuite/gdb.chill/chexp.exp b/gdb/testsuite/gdb.chill/chexp.exp index 0b4a77d7315..44fe38d8ec0 100644 --- a/gdb/testsuite/gdb.chill/chexp.exp +++ b/gdb/testsuite/gdb.chill/chexp.exp @@ -60,58 +60,58 @@ proc test_integer_literals_accepted {} { # Test various decimal values. - test_print_accept "p 123" "123" - test_print_accept "p -123" "-123" - test_print_accept "p D'123" "123" - test_print_accept "p d'123" "123" - test_print_accept "p -D'123" "-123" - test_print_accept "p -d'123" "-123" - test_print_accept "p 123_456" "123456" - test_print_accept "p __1_2_3__" "123" - test_print_accept "p/d 123" "D'123" + gdb_test "p 123" " = 123" + gdb_test "p -123" " = -123" + gdb_test "p D'123" " = 123" + gdb_test "p d'123" " = 123" + gdb_test "p -D'123" " = -123" + gdb_test "p -d'123" " = -123" + gdb_test "p 123_456" " = 123456" + gdb_test "p __1_2_3__" " = 123" + gdb_test "p/d 123" " = D'123" # Test various binary values. - test_print_accept "p B'111" "7" - test_print_accept "p b'111" "7" - test_print_accept "p -B'111" "-7" - test_print_accept "p B'0111" "7" - test_print_accept "p b'0111" "7" - test_print_accept "p -b'0111" "-7" - test_print_accept "p B'_0_1_1_1_" "7" - test_print_accept "p b'_0_1_1_1_" "7" - test_print_accept "p -b'_0_1_1_1_" "-7" - test_print_accept "p/t B'111" "B'111" + gdb_test "p B'111" " = 7" + gdb_test "p b'111" " = 7" + gdb_test "p -B'111" " = -7" + gdb_test "p B'0111" " = 7" + gdb_test "p b'0111" " = 7" + gdb_test "p -b'0111" " = -7" + gdb_test "p B'_0_1_1_1_" " = 7" + gdb_test "p b'_0_1_1_1_" " = 7" + gdb_test "p -b'_0_1_1_1_" " = -7" + gdb_test "p/t B'111" " = B'111" # Test various octal values. - test_print_accept "p O'123" "83" - test_print_accept "p o'123" "83" - test_print_accept "p -o'0123" "-83" - test_print_accept "p O'0123" "83" - test_print_accept "p o'0123" "83" - test_print_accept "p -o'123" "-83" - test_print_accept "p O'_1_2_3_" "83" - test_print_accept "p o'_1_2_3_" "83" - test_print_accept "p -o'_1_2_3_" "-83" - test_print_accept "p/o O'123" "O'123" + gdb_test "p O'123" " = 83" + gdb_test "p o'123" " = 83" + gdb_test "p -o'0123" " = -83" + gdb_test "p O'0123" " = 83" + gdb_test "p o'0123" " = 83" + gdb_test "p -o'123" " = -83" + gdb_test "p O'_1_2_3_" " = 83" + gdb_test "p o'_1_2_3_" " = 83" + gdb_test "p -o'_1_2_3_" " = -83" + gdb_test "p/o O'123" " = O'123" # Test various hexadecimal values. - test_print_accept "p H'123" "291" - test_print_accept "p h'123" "291" - test_print_accept "p -h'123" "-291" - test_print_accept "p H'0123" "291" - test_print_accept "p h'0123" "291" - test_print_accept "p -h'0123" "-291" - test_print_accept "p H'_1_2_3_" "291" - test_print_accept "p h'_1_2_3_" "291" - test_print_accept "p -h'_1_2_3_" "-291" - test_print_accept "p H'ABCDEF" "11259375" - test_print_accept "p H'abcdef" "11259375" - test_print_accept "p H'AbCdEf" "11259375" - test_print_accept "p H'_A_b_C_d_E_f_" "11259375" - test_print_accept "p/x H'123" "H'123" + gdb_test "p H'123" " = 291" + gdb_test "p h'123" " = 291" + gdb_test "p -h'123" " = -291" + gdb_test "p H'0123" " = 291" + gdb_test "p h'0123" " = 291" + gdb_test "p -h'0123" " = -291" + gdb_test "p H'_1_2_3_" " = 291" + gdb_test "p h'_1_2_3_" " = 291" + gdb_test "p -h'_1_2_3_" " = -291" + gdb_test "p H'ABCDEF" " = 11259375" + gdb_test "p H'abcdef" " = 11259375" + gdb_test "p H'AbCdEf" " = 11259375" + gdb_test "p H'_A_b_C_d_E_f_" " = 11259375" + gdb_test "p/x H'123" " = H'123" } proc test_character_literals_accepted {} { @@ -119,16 +119,16 @@ proc test_character_literals_accepted {} { # Test various decimal values. - test_print_accept "p 'a'" "'a'" - test_print_accept "p/x 'a'" "H'61" - test_print_accept "p/d 'a'" "D'97" - test_print_accept "p/t 'a'" "B'1100001" - # test_print_accept "p '^(97)'" "'a'" (not in GNU Chill) - test_print_accept "p C'61'" "'a'" - test_print_accept "p c'61'" "'a'" - test_print_accept "p/x C'FF'" "H'ff" - # test_print_accept "p/x '^(H'FF)'" "H'ff" (not in GNU Chill) - # test_print_accept "p/x '^(D'255)'" "H'ff" (not in GNU Chill) + gdb_test "p 'a'" " = 'a'" + gdb_test "p/x 'a'" " = H'61" + gdb_test "p/d 'a'" " = D'97" + gdb_test "p/t 'a'" " = B'1100001" + # gdb_test "p '^(97)'" " = 'a'" (not in GNU Chill) + gdb_test "p C'61'" " = 'a'" + gdb_test "p c'61'" " = 'a'" + gdb_test "p/x C'FF'" " = H'ff" + # gdb_test "p/x '^(H'FF)'" " = H'ff" (not in GNU Chill) + # gdb_test "p/x '^(D'255)'" " = H'ff" (not in GNU Chill) } proc test_integer_literals_rejected {} { @@ -181,8 +181,8 @@ proc test_boolean_literals_accepted {} { # Test the only possible values for a boolean, TRUE and FALSE. - test_print_accept "p TRUE" "TRUE" - test_print_accept "p FALSE" "FALSE" + gdb_test "p TRUE" " = TRUE" + gdb_test "p FALSE" " = FALSE" } proc test_float_literals_accepted {} { @@ -190,59 +190,59 @@ proc test_float_literals_accepted {} { # Test various floating point formats - test_print_accept "p .44 < .45" "1" - test_print_accept "p .44 > .45" "0" - test_print_accept "p 0.44 < 0.45" "1" - test_print_accept "p 0.44 > 0.45" "0" - test_print_accept "p 44. < 45." "1" - test_print_accept "p 44. > 45." "0" - test_print_accept "p 44.0 < 45.0" "1" - test_print_accept "p 44.0 > 45.0" "0" - test_print_accept "p 10D20 < 10D21" "1" - test_print_accept "p 10D20 > 10D21" "0" - test_print_accept "p 10d20 < 10d21" "1" - test_print_accept "p 10d20 > 10d21" "0" - test_print_accept "p 10E20 < 10E21" "1" - test_print_accept "p 10E20 > 10E21" "0" - test_print_accept "p 10e20 < 10e21" "1" - test_print_accept "p 10e20 > 10e21" "0" - test_print_accept "p 10.D20 < 10.D21" "1" - test_print_accept "p 10.D20 > 10.D21" "0" - test_print_accept "p 10.d20 < 10.d21" "1" - test_print_accept "p 10.d20 > 10.d21" "0" - test_print_accept "p 10.E20 < 10.E21" "1" - test_print_accept "p 10.E20 > 10.E21" "0" - test_print_accept "p 10.e20 < 10.e21" "1" - test_print_accept "p 10.e20 > 10.e21" "0" - test_print_accept "p 10.0D20 < 10.0D21" "1" - test_print_accept "p 10.0D20 > 10.0D21" "0" - test_print_accept "p 10.0d20 < 10.0d21" "1" - test_print_accept "p 10.0d20 > 10.0d21" "0" - test_print_accept "p 10.0E20 < 10.0E21" "1" - test_print_accept "p 10.0E20 > 10.0E21" "0" - test_print_accept "p 10.0e20 < 10.0e21" "1" - test_print_accept "p 10.0e20 > 10.0e21" "0" - test_print_accept "p 10.0D+20 < 10.0D+21" "1" - test_print_accept "p 10.0D+20 > 10.0D+21" "0" - test_print_accept "p 10.0d+20 < 10.0d+21" "1" - test_print_accept "p 10.0d+20 > 10.0d+21" "0" - test_print_accept "p 10.0E+20 < 10.0E+21" "1" - test_print_accept "p 10.0E+20 > 10.0E+21" "0" - test_print_accept "p 10.0e+20 < 10.0e+21" "1" - test_print_accept "p 10.0e+20 > 10.0e+21" "0" - test_print_accept "p 10.0D-11 < 10.0D-10" "1" - test_print_accept "p 10.0D-11 > 10.0D-10" "0" - test_print_accept "p 10.0d-11 < 10.0d-10" "1" - test_print_accept "p 10.0d-11 > 10.0d-10" "0" - test_print_accept "p 10.0E-11 < 10.0E-10" "1" - test_print_accept "p 10.0E-11 > 10.0E-10" "0" - test_print_accept "p 10.0e-11 < 10.0e-10" "1" - test_print_accept "p 10.0e-11 > 10.0e-10" "0" + gdb_test "p .44 < .45" " = 1" + gdb_test "p .44 > .45" " = 0" + gdb_test "p 0.44 < 0.45" " = 1" + gdb_test "p 0.44 > 0.45" " = 0" + gdb_test "p 44. < 45." " = 1" + gdb_test "p 44. > 45." " = 0" + gdb_test "p 44.0 < 45.0" " = 1" + gdb_test "p 44.0 > 45.0" " = 0" + gdb_test "p 10D20 < 10D21" " = 1" + gdb_test "p 10D20 > 10D21" " = 0" + gdb_test "p 10d20 < 10d21" " = 1" + gdb_test "p 10d20 > 10d21" " = 0" + gdb_test "p 10E20 < 10E21" " = 1" + gdb_test "p 10E20 > 10E21" " = 0" + gdb_test "p 10e20 < 10e21" " = 1" + gdb_test "p 10e20 > 10e21" " = 0" + gdb_test "p 10.D20 < 10.D21" " = 1" + gdb_test "p 10.D20 > 10.D21" " = 0" + gdb_test "p 10.d20 < 10.d21" " = 1" + gdb_test "p 10.d20 > 10.d21" " = 0" + gdb_test "p 10.E20 < 10.E21" " = 1" + gdb_test "p 10.E20 > 10.E21" " = 0" + gdb_test "p 10.e20 < 10.e21" " = 1" + gdb_test "p 10.e20 > 10.e21" " = 0" + gdb_test "p 10.0D20 < 10.0D21" " = 1" + gdb_test "p 10.0D20 > 10.0D21" " = 0" + gdb_test "p 10.0d20 < 10.0d21" " = 1" + gdb_test "p 10.0d20 > 10.0d21" " = 0" + gdb_test "p 10.0E20 < 10.0E21" " = 1" + gdb_test "p 10.0E20 > 10.0E21" " = 0" + gdb_test "p 10.0e20 < 10.0e21" " = 1" + gdb_test "p 10.0e20 > 10.0e21" " = 0" + gdb_test "p 10.0D+20 < 10.0D+21" " = 1" + gdb_test "p 10.0D+20 > 10.0D+21" " = 0" + gdb_test "p 10.0d+20 < 10.0d+21" " = 1" + gdb_test "p 10.0d+20 > 10.0d+21" " = 0" + gdb_test "p 10.0E+20 < 10.0E+21" " = 1" + gdb_test "p 10.0E+20 > 10.0E+21" " = 0" + gdb_test "p 10.0e+20 < 10.0e+21" " = 1" + gdb_test "p 10.0e+20 > 10.0e+21" " = 0" + gdb_test "p 10.0D-11 < 10.0D-10" " = 1" + gdb_test "p 10.0D-11 > 10.0D-10" " = 0" + gdb_test "p 10.0d-11 < 10.0d-10" " = 1" + gdb_test "p 10.0d-11 > 10.0d-10" " = 0" + gdb_test "p 10.0E-11 < 10.0E-10" " = 1" + gdb_test "p 10.0E-11 > 10.0E-10" " = 0" + gdb_test "p 10.0e-11 < 10.0e-10" " = 1" + gdb_test "p 10.0e-11 > 10.0e-10" " = 0" # looks funny, but apparently legal - test_print_accept "p _.1e+10 < _.1e+11" "1" - test_print_accept "p _.1e+10 > _.1e+11" "0" - test_print_accept "p __.1e-12 < __.1e-11" "1" - test_print_accept "p __.1e-12 > __.1e-11" "0" + gdb_test "p _.1e+10 < _.1e+11" " = 1" + gdb_test "p _.1e+10 > _.1e+11" " = 0" + gdb_test "p __.1e-12 < __.1e-11" " = 1" + gdb_test "p __.1e-12 > __.1e-11" " = 0" } proc test_convenience_variables {} { @@ -329,63 +329,63 @@ proc test_arithmetic_expressions {} { # Test unary minus with various operands -# test_print_accept "p -(TRUE)" "-1" "unary minus applied to bool" -# test_print_accept "p -('a')" "xxx" "unary minus applied to char" - test_print_accept "p -(1)" "-1" "unary minus applied to int" - test_print_accept "p -(1.0)" "-1" "unary minus applied to real" +# gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool" +# gdb_test "p -('a')" " = xxx" "unary minus applied to char" + gdb_test "p -(1)" " = -1" "unary minus applied to int" + gdb_test "p -(1.0)" " = -1" "unary minus applied to real" # Test addition with various operands - test_print_accept "p TRUE + 1" "2" "bool plus int" - test_print_accept "p 'a' + 1" "98" "char plus int" - test_print_accept "p 1 + 1" "2" "int plus int" - test_print_accept "p 1.0 + 1" "2" "real plus int" - test_print_accept "p 1.0 + 2.0" "3" "real plus real" + gdb_test "p TRUE + 1" " = 2" "bool plus int" + gdb_test "p 'a' + 1" " = 98" "char plus int" + gdb_test "p 1 + 1" " = 2" "int plus int" + gdb_test "p 1.0 + 1" " = 2" "real plus int" + gdb_test "p 1.0 + 2.0" " = 3" "real plus real" # Test subtraction with various operands - test_print_accept "p TRUE - 1" "0" "bool minus int" - test_print_accept "p 'b' - 1" "97" "char minus int" - test_print_accept "p 3 - 1" "2" "int minus int" - test_print_accept "p 3.0 - 1" "2" "real minus int" - test_print_accept "p 5.0 - 2.0" "3" "real minus real" + gdb_test "p TRUE - 1" " = 0" "bool minus int" + gdb_test "p 'b' - 1" " = 97" "char minus int" + gdb_test "p 3 - 1" " = 2" "int minus int" + gdb_test "p 3.0 - 1" " = 2" "real minus int" + gdb_test "p 5.0 - 2.0" " = 3" "real minus real" # Test multiplication with various operands - test_print_accept "p TRUE * 1" "1" "bool times int" - test_print_accept "p 'a' * 2" "194" "char times int" - test_print_accept "p 2 * 3" "6" "int times int" - test_print_accept "p 2.0 * 3" "6" "real times int" - test_print_accept "p 2.0 * 3.0" "6" "real times real" + gdb_test "p TRUE * 1" " = 1" "bool times int" + gdb_test "p 'a' * 2" " = 194" "char times int" + gdb_test "p 2 * 3" " = 6" "int times int" + gdb_test "p 2.0 * 3" " = 6" "real times int" + gdb_test "p 2.0 * 3.0" " = 6" "real times real" # Test division with various operands - test_print_accept "p TRUE / 1" "1" "bool divided by int" - test_print_accept "p 'a' / 2" "48" "char divided by int" - test_print_accept "p 6 / 3" "2" "int divided by int" - test_print_accept "p 6.0 / 3" "2" "real divided by int" - test_print_accept "p 6.0 / 3.0" "2" "real divided by real" + gdb_test "p TRUE / 1" " = 1" "bool divided by int" + gdb_test "p 'a' / 2" " = 48" "char divided by int" + gdb_test "p 6 / 3" " = 2" "int divided by int" + gdb_test "p 6.0 / 3" " = 2" "real divided by int" + gdb_test "p 6.0 / 3.0" " = 2" "real divided by real" # Test modulo with various operands - test_print_accept "p TRUE MOD 1" "0" "bool modulo int" - test_print_accept "p 'a' MOD 2" "1" "char modulo int" - test_print_accept "p -5 MOD 3" "1" "negative int modulo int" - test_print_accept "p 5 MOD 1" "0" "int modulo int" - test_print_accept "p 5 MOD 2" "1" "int modulo int" - test_print_accept "p 5 MOD 3" "2" "int modulo int" - test_print_accept "p 5 MOD 4" "1" "int modulo int" - test_print_accept "p 5 MOD 5" "0" "int modulo int" - test_print_accept "p 0 MOD 1" "0" "int modulo int" - test_print_accept "p 0 MOD 2" "0" "int modulo int" - test_print_accept "p 0 MOD 3" "0" "int modulo int" - test_print_accept "p 0 MOD 4" "0" "int modulo int" - test_print_accept "p -5 MOD 1" "0" "int modulo int" - test_print_accept "p -5 MOD 2" "1" "int modulo int" - test_print_accept "p -5 MOD 3" "1" "int modulo int" - test_print_accept "p -5 MOD 4" "3" "int modulo int" - test_print_accept "p -5 MOD 5" "0" "int modulo int" - test_print_accept "p -5 MOD 5" "0" "int modulo int" + gdb_test "p TRUE MOD 1" " = 0" "bool modulo int" + gdb_test "p 'a' MOD 2" " = 1" "char modulo int" + gdb_test "p -5 MOD 3" " = 1" "negative int modulo int" + gdb_test "p 5 MOD 1" " = 0" "int modulo int" + gdb_test "p 5 MOD 2" " = 1" "int modulo int" + gdb_test "p 5 MOD 3" " = 2" "int modulo int" + gdb_test "p 5 MOD 4" " = 1" "int modulo int" + gdb_test "p 5 MOD 5" " = 0" "int modulo int" + gdb_test "p 0 MOD 1" " = 0" "int modulo int" + gdb_test "p 0 MOD 2" " = 0" "int modulo int" + gdb_test "p 0 MOD 3" " = 0" "int modulo int" + gdb_test "p 0 MOD 4" " = 0" "int modulo int" + gdb_test "p -5 MOD 1" " = 0" "int modulo int" + gdb_test "p -5 MOD 2" " = 1" "int modulo int" + gdb_test "p -5 MOD 3" " = 1" "int modulo int" + gdb_test "p -5 MOD 4" " = 3" "int modulo int" + gdb_test "p -5 MOD 5" " = 0" "int modulo int" + gdb_test "p -5 MOD 5" " = 0" "int modulo int" test_print_reject "p 6.0 MOD 3" \ "Integer-only operation on floating point number.*" test_print_reject "p 6.0 MOD 3.0" \ @@ -397,29 +397,29 @@ proc test_arithmetic_expressions {} { # Test remainder with various operands - test_print_accept "p TRUE REM 1" "0" "bool remainder int" - test_print_accept "p 'a' REM 2" "1" "char remainder int" - test_print_accept "p 5 REM 5" "0" "int remainder int" - test_print_accept "p 5 REM 4" "1" "int remainder int" - test_print_accept "p 5 REM 3" "2" "int remainder int" - test_print_accept "p 5 REM 2" "1" "int remainder int" - test_print_accept "p 5 REM 1" "0" "int remainder int" - test_print_accept "p 5 REM -1" "0" "int remainder int" - test_print_accept "p 5 REM -2" "1" "int remainder int" - test_print_accept "p 5 REM -3" "2" "int remainder int" - test_print_accept "p 5 REM -4" "1" "int remainder int" - test_print_accept "p 5 REM -5" "0" "int remainder int" - test_print_accept "p -5 REM 5" "0" "int remainder int" - test_print_accept "p -5 REM 4" "-1" "int remainder int" - test_print_accept "p -5 REM 3" "-2" "int remainder int" - test_print_accept "p -5 REM 2" "-1" "int remainder int" - test_print_accept "p -5 REM 1" "0" "int remainder int" - test_print_accept "p -5 REM -1" "0" "int remainder int" - test_print_accept "p -5 REM -2" "-1" "int remainder int" - test_print_accept "p -5 REM -3" "-2" "int remainder int" - test_print_accept "p -5 REM -4" "-1" "int remainder int" - test_print_accept "p -5 REM -5" "0" "int remainder int" - test_print_accept "p 6 REM 3" "0" "int remainder int" + gdb_test "p TRUE REM 1" " = 0" "bool remainder int" + gdb_test "p 'a' REM 2" " = 1" "char remainder int" + gdb_test "p 5 REM 5" " = 0" "int remainder int" + gdb_test "p 5 REM 4" " = 1" "int remainder int" + gdb_test "p 5 REM 3" " = 2" "int remainder int" + gdb_test "p 5 REM 2" " = 1" "int remainder int" + gdb_test "p 5 REM 1" " = 0" "int remainder int" + gdb_test "p 5 REM -1" " = 0" "int remainder int" + gdb_test "p 5 REM -2" " = 1" "int remainder int" + gdb_test "p 5 REM -3" " = 2" "int remainder int" + gdb_test "p 5 REM -4" " = 1" "int remainder int" + gdb_test "p 5 REM -5" " = 0" "int remainder int" + gdb_test "p -5 REM 5" " = 0" "int remainder int" + gdb_test "p -5 REM 4" " = -1" "int remainder int" + gdb_test "p -5 REM 3" " = -2" "int remainder int" + gdb_test "p -5 REM 2" " = -1" "int remainder int" + gdb_test "p -5 REM 1" " = 0" "int remainder int" + gdb_test "p -5 REM -1" " = 0" "int remainder int" + gdb_test "p -5 REM -2" " = -1" "int remainder int" + gdb_test "p -5 REM -3" " = -2" "int remainder int" + gdb_test "p -5 REM -4" " = -1" "int remainder int" + gdb_test "p -5 REM -5" " = 0" "int remainder int" + gdb_test "p 6 REM 3" " = 0" "int remainder int" test_print_reject "p 6.0 REM 3" \ "Integer-only operation on floating point number.*" test_print_reject "p 6.0 REM 3.0" \ diff --git a/gdb/testsuite/gdb.chill/misc.exp b/gdb/testsuite/gdb.chill/misc.exp index dea886e96d5..e80057d3c95 100644 --- a/gdb/testsuite/gdb.chill/misc.exp +++ b/gdb/testsuite/gdb.chill/misc.exp @@ -67,13 +67,13 @@ send "set print sevenbit-strings\n" ; expect -re ".*$prompt $" if ![set_lang_chill] then { runto dummyfunc # check upper/lower case - test_print_accept "ptype BOOL" "(bool|BOOL)" - test_print_accept "ptype bool" "(bool|BOOL)" - test_print_accept "print otto" "42" - test_print_accept "print OTTO" "42" - test_print_accept "print otTO" "42" - test_print_accept "print OTto" "42" - test_print_accept "print NULL" "NULL" "print emptiness literal" + gdb_test "ptype BOOL" " = (bool|BOOL)" + gdb_test "ptype bool" " = (bool|BOOL)" + gdb_test "print otto" " = 42" + gdb_test "print OTTO" " = 42" + gdb_test "print otTO" " = 42" + gdb_test "print OTto" " = 42" + gdb_test "print NULL" " = NULL" "print emptiness literal" gdb_test "info line" \ {Line 5 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\ diff --git a/gdb/testsuite/gdb.chill/pr-6292.exp b/gdb/testsuite/gdb.chill/pr-6292.exp index 2af77cee587..909d0bcfb38 100644 --- a/gdb/testsuite/gdb.chill/pr-6292.exp +++ b/gdb/testsuite/gdb.chill/pr-6292.exp @@ -42,7 +42,7 @@ proc do_tests {} { send "run\n"; expect -re "Breakpoint .*pr-6292.ch:15.*$prompt $" gdb_test_exact "call klaus()" {here's klaus calling.} gdb_test {set fred(10, i)} {a was '10'; b was '12'.} - test_print_accept "print i" {13} "print i after call" + gdb_test "print i" { = 13} "print i after call" } # Check to see if we have an executable to test. If not, then either we diff --git a/gdb/testsuite/gdb.chill/string.exp b/gdb/testsuite/gdb.chill/string.exp index 2c5ed5a05d4..a4368d94e32 100644 --- a/gdb/testsuite/gdb.chill/string.exp +++ b/gdb/testsuite/gdb.chill/string.exp @@ -38,14 +38,14 @@ proc do_tests {} { # These tests based on Cygnus PR chill/5696. runto string.ch:11 - test_print_accept "p s20" {"Moser Wilfried"} "print simple vstring" - test_print_accept "p s20(1)" {'o'} "print vstring element" - test_print_accept "p s20(1:3)" {"ose"} "print vstring slice (:)" - test_print_accept "p s20(2 up 3)" {"ser"} "print vstring slice (up)" - test_print_accept "p s10" {"1234567890"} "print simple string" - test_print_accept "p s10(1)" {'2'} "print string element" - test_print_accept "p s10(1:3)" {"234"} "print string slice (:)" - test_print_accept "p s10(2 up 3)" {"345"} "print string slice (up)" + gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring" + gdb_test "p s20(1)" { = 'o'} "print vstring element" + gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)" + gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)" + gdb_test "p s10" { = "1234567890"} "print simple string" + gdb_test "p s10(1)" { = '2'} "print string element" + gdb_test "p s10(1:3)" { = "234"} "print string slice (:)" + gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)" } # Check to see if we have an executable to test. If not, then either we diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp index 2251a049fbe..9f7c7470f60 100644 --- a/gdb/testsuite/gdb.chill/tuples.exp +++ b/gdb/testsuite/gdb.chill/tuples.exp @@ -103,10 +103,10 @@ proc do_tests {} { send "break printdow\n" ; expect -re "$prompt $" send "continue\n" ; expect -re "$prompt $" send "set var w:= dow\[monday\]\n" ; expect -re "$prompt $" - test_print_accept "print w" "\\\[monday\\\]" \ + gdb_test "print w" " = \\\[monday\\\]" \ "print bitstring after assignment" send "set var w:=\[\]\n" ; expect -re "$prompt $" - test_print_accept "print w" "\\\[\\\]" \ + gdb_test "print w" " = \\\[\\\]" \ "print bitstring after assignment of \[\]" } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f64a0b7ef2f..af747a57943 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -282,64 +282,7 @@ proc gdb_test { args } { return $result } -# Testing printing of a specific value. For passes and fails, return -# a 1 to indicate that more tests can proceed. However a timeout -# is a serious error, generates a special fail message, and causes -# a 0 to be returned to indicate that more tests are likely to fail -# as well. -# -# Args are: -# -# First one is string to send to gdb -# Second one is string to match gdb result to -# Third one is an optional message to be printed -# -# This differs from gdb_test in a few ways: (1) handling of empty -# sendthis (I suspect test_print_accept callers never use this), (2) -# it tests for the " =" (that could easily be moved to the callers. - -proc test_print_accept { args } { - global prompt - global verbose - - if [llength $args]==3 then { - set message [lindex $args 2] - } else { - set message [lindex $args 0] - } - set sendthis [lindex $args 0] - set expectthis [lindex $args 1] - if $verbose>2 then { - send_user "Sending \"$sendthis\" to gdb\n" - send_user "Looking to match \"$expectthis\"\n" - send_user "Message is \"$message\"\n" - } - send "$sendthis\n" - expect { - -re ".* = $expectthis\r\n$prompt $" { - if ![string match "" $message] then { - pass "$sendthis ($message)" - } else { - pass "$sendthis" - } - return 1 - } - -re ".*$prompt $" { - if ![string match "" $message] then { - fail "$sendthis ($message)" - } else { - fail "$sendthis" - } - return 1 - } - timeout { - fail "$sendthis (timeout)" - return 0 - } - } -} - -# Testing printing of a specific value. For pass or fail, return +# Test that a command gives an error. For pass or fail, return # a 1 to indicate that more tests can proceed. However a timeout # is a serious error, generates a special fail message, and causes # a 0 to be returned to indicate that more tests are likely to fail -- 2.30.2