aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorPaul Koning <pkoning@equallogic.com>2011-11-15 21:17:40 +0000
committerPaul Koning <pkoning@equallogic.com>2011-11-15 21:17:40 +0000
commit7742673004afc257ab75255c7601347edc131c95 (patch)
tree5e7eeea886679c4f9d1528652f46086ca66e1f00 /gdb/testsuite/gdb.python
parent9cc10fd15085bda62b582d484d778f6642483748 (diff)
downloadgdb-7742673004afc257ab75255c7601347edc131c95.zip
gdb-7742673004afc257ab75255c7601347edc131c95.tar.gz
gdb-7742673004afc257ab75255c7601347edc131c95.tar.bz2
* gdb.python/py-type.exp: New testcases for exceptions on scalar types
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-type.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
index 3578a7e..056f4e1 100644
--- a/gdb/testsuite/gdb.python/py-type.exp
+++ b/gdb/testsuite/gdb.python/py-type.exp
@@ -97,6 +97,16 @@ proc test_fields {lang} {
gdb_test "python print \[(n, v.bitpos) for (n, v) in st.type.items()\]" {\[\('a', 0L\), \('b', 32L\)\]} "Check fields items list"
gdb_test "python print 'a' in st.type" "True" "Check field name exists test"
gdb_test "python print 'nosuch' in st.type" "False" "Check field name nonexists test"
+ gdb_test "python print not not st.type" "True" "Check conversion to bool"
+
+ # Test rejection of mapping operations on scalar types
+ gdb_test "python print len (st.type\['a'\].type)" "TypeError: Type is not a structure, union, or enum type.*"
+ gdb_test "python print st.type\['a'\].type.has_key ('x')" "TypeError: Type is not a structure, union, or enum type.*"
+ gdb_test "python print st.type\['a'\].type.keys ()" "TypeError: Type is not a structure, union, or enum type.*"
+ gdb_test "python print st.type\['a'\].type\['x'\]" "TypeError: Type is not a structure, union, or enum type.*"
+
+ # Test conversion to bool on scalar types
+ gdb_test "python print not not st.type\['a'\].type" "True"
# Test regression PR python/10805
gdb_py_test_silent_cmd "print ar" "print value" 1