On 01/21/2012 05:43 AM, David Malcolm wrote:
The most obvious issue with the patch (based on a quick visual
review)
is that it adds lots of new functionality to the plugin, but is missing
unit tests for each new part of the functionality. For example, I see
you added a "values" attribute to gcc.EnumeralType. That looks useful,
but I'm left wondering how I'd programatically access both the names and
the numeric values. Ideally such a change also ought to add a test e.g.
a directory "tests/plugin/enums" or somesuch, with an:
input.c or (input.cc for C++)
script.py (exercising the relevant code)
stdout.txt: containing the expected output from the script.
True, tests are glaringly missing; will add them. (In the specific case
of gcc.EnumeralType.values, not sure how to use it exactly either. :)
All I needed was to find out whether a given enum type has exactly one
value, so "len(t.values) == 1" is all I ever did with it...)
Thanks for the feedback,
Stephan