]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb.python/py-type.exp: New testcases for exceptions on scalar types
authorPaul Koning <pkoning@equallogic.com>
Tue, 15 Nov 2011 21:17:40 +0000 (21:17 +0000)
committerPaul Koning <pkoning@equallogic.com>
Tue, 15 Nov 2011 21:17:40 +0000 (21:17 +0000)
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-type.exp

index d71e46c1e6264aba0d83ba61986d742426eb2a4a..b65305752b7c296faa01c64171fa6fcb4c8e5f3d 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-15  Paul Koning  <paul_koning@dell.com>
+
+       * gdb.python/py-type.exp: New testcases for exceptions on scalar
+       types.
+
 2011-11-14  Doug Evans  <dje@google.com>
 
        * gdb.base/shell.exp: New file.
index 3578a7e226735ef7d99c1e8bac17e65d1b6430eb..056f4e1232bcbebfb7fb76c768ab9bbe5b9ad5fa 100644 (file)
@@ -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