diff options
author | Pedro Alves <palves@redhat.com> | 2008-12-29 02:18:48 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-12-29 02:18:48 +0000 |
commit | 09e6485fa9d137478b21711ab590b98c9135ed96 (patch) | |
tree | bea132c51eea18fb4b38b281593385d2f4b9550c /gdb/testsuite/gdb.base/radix.exp | |
parent | b828adc616ce19f60b552742361ebb5da3a6c220 (diff) | |
download | binutils-gdb-09e6485fa9d137478b21711ab590b98c9135ed96.tar.gz |
2008-12-29 Pedro Alves <pedro@codesourcery.com>
PR gdb/7536:
* valprint.c (input_radix_1): New static global.
(set_input_radix): Use it instead of "input_radix".
(set_input_radix_1): Always leave input_radix_1 set to
input_radix.
(output_radix_1): New static global.
(set_output_radix): Use it instead of "output_radix".
(set_output_radix_1): Always leave output_radix_1 set to
output_radix.
(_initialize_valprint): Use "input_radix_1" instead of
"input_radix" with the "input-radix" command. Use
"output_radix_1" instead of "output_radix" with the "output-radix"
command.
2008-12-29 Pedro Alves <pedro@codesourcery.com>
PR gdb/7536:
* gdb.base/radix.exp: Add tests to ensure invalid input radices
and unsupported output radices are really rejected.
Diffstat (limited to 'gdb/testsuite/gdb.base/radix.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/radix.exp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp index f4b8c2d51d1..89ec259a7c9 100644 --- a/gdb/testsuite/gdb.base/radix.exp +++ b/gdb/testsuite/gdb.base/radix.exp @@ -154,3 +154,31 @@ test_output_radix 16 "10" "20" setup_kfail *-*-* "gdb/1715" test_one_output 16 "20." "14" test_one_output 16 "(int) 20." "14" + +# Test rejecting invalid input radices and unsupported output radices +# really rejects the radices, instead of just claiming so (PR 7536). + +gdb_test "set radix" \ + "Input and output radices now set to decimal 10, hex a, octal 12\." \ + "Reset radices" + +gdb_test "set input-radix 1" \ + "Nonsense input radix ``decimal 1''; input radix unchanged\\." \ + "Reject input-radix 1" +gdb_test "show input-radix" \ + "Default input radix for entering numbers is 10\\." \ + "Input radix unchanged after rejection" + +gdb_test "set output-radix 1" \ + "Unsupported output radix ``decimal 1''; output radix unchanged\\." \ + "Reject output-radix 1" +gdb_test "show output-radix" \ + "Default output radix for printing of values is 10\\." \ + "Output radix unchanged after rejection" + +gdb_test "set radix 7" \ + "Unsupported output radix ``decimal 7''; output radix unchanged\\." \ + "set radix 7 rejected" +gdb_test "show output-radix" \ + "Default output radix for printing of values is 10\\." \ + "Output radix unchanged after rejection through set radix command" |