js/src/gdb/tests/test-prettyprinters.py

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 import mozilla.prettyprinters
     3 run_fragment('prettyprinters.implemented_types')
     5 def implemented_type_names(expr):
     6     v = gdb.parse_and_eval(expr)
     7     it = mozilla.prettyprinters.implemented_types(v.type)
     8     return [str(_) for _ in it]
    10 assert_eq(implemented_type_names('i'), ['int'])
    11 assert_eq(implemented_type_names('a'), ['A', 'int'])
    12 assert_eq(implemented_type_names('b'), ['B', 'A', 'int'])
    13 assert_eq(implemented_type_names('c'), ['C'])
    14 assert_eq(implemented_type_names('c_'), ['C_', 'C'])
    15 assert_eq(implemented_type_names('e'), ['E', 'C', 'D'])
    16 assert_eq(implemented_type_names('e_'), ['E_', 'E', 'C', 'D'])
    17 assert_eq(implemented_type_names('f'), ['F', 'C', 'D'])
    18 assert_eq(implemented_type_names('h'), ['H', 'F', 'G', 'C', 'D'])
    20 # Check that our pretty-printers aren't interfering with printing other types.
    21 assert_pretty('10', '10')
    22 assert_pretty('(void*) 0', '') # Because of 'set print address off'

mercurial