aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-08-23 20:26:10 +0000
committerTom Tromey <tromey@redhat.com>2010-08-23 20:26:10 +0000
commitd839c8a4e8665e408dfcdf3c8e8cc7f054ade108 (patch)
tree0f5562ffd318469521cdea212f54d7dbb5a5b2d3 /gdb/testsuite/gdb.python
parent05d0e1e74e28e8b02bd0a79c04a7a3f960b8000b (diff)
downloadbinutils-d839c8a4e8665e408dfcdf3c8e8cc7f054ade108.zip
binutils-d839c8a4e8665e408dfcdf3c8e8cc7f054ade108.tar.gz
binutils-d839c8a4e8665e408dfcdf3c8e8cc7f054ade108.tar.bz2
gdb
PR python/10676: * python/py-type.c: Include bcache.h, vec.h. (struct type_equality_entry): New. (compare_strings): New function. (check_types_equal): Likewise. (check_types_worklist): Likewise. (typy_richcompare): Likewise. (type_object_type): Set tp_richcompare field. gdb/testsuite PR python/10676: * gdb.python/py-type.exp (test_fields): Add tests for type equality.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-type.exp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
index 095711f..10bb652 100644
--- a/gdb/testsuite/gdb.python/py-type.exp
+++ b/gdb/testsuite/gdb.python/py-type.exp
@@ -81,6 +81,10 @@ proc test_fields {lang} {
gdb_test "python print len(fields)" "2" "Check number of fields"
gdb_test "python print fields\[0\].name" "c" "Check class field c name"
gdb_test "python print fields\[1\].name" "d" "Check class field d name"
+
+ gdb_test "python print c.type == gdb.parse_and_eval('d').type" "False"
+ gdb_test "python print c.type == gdb.parse_and_eval('d').type.fields()\[0\].type" \
+ "True"
}
# Test normal fields usage in structs.
@@ -102,6 +106,8 @@ proc test_fields {lang} {
".1, 2." "cast to array with one argument"
gdb_test "python print ar\[0\].cast(ar\[0\].type.array(0, 1))" \
".1, 2." "cast to array with two arguments"
+
+ gdb_test "python print ar\[0\].type == ar\[0\].type" "True"
}
proc test_base_class {} {