On Wed, May 02, 2012 at 07:33:50PM +0200, Manuel Klimek wrote: > Also, the surrounding style seems to use kSomething for file level > string constants, so I'd use that for the test, too. In general, I'd > make it look like the tests in test_cursor.py already do.
Indeed, this was an old patch that popped up when I rebased, and I should have noticed that it could be rewritten to use the new helpers. I actually think it makes more sense to put that testcase in test_cursor.py. Updated patch attached. Thanks again for the review. anders
>From 3cbf3689f17b7f187ac1369f984096390cbaacef Mon Sep 17 00:00:00 2001 From: Anders Waldenborg <[email protected]> Date: Mon, 19 Dec 2011 13:53:53 +0100 Subject: [PATCH 2/2] [python] Add testcase for annotation cursor kind --- bindings/python/tests/cindex/test_cursor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py index c88aec1..0582d2a 100644 --- a/bindings/python/tests/cindex/test_cursor.py +++ b/bindings/python/tests/cindex/test_cursor.py @@ -135,3 +135,15 @@ def test_enum_values_cpp(): assert ham.kind == CursorKind.ENUM_CONSTANT_DECL assert ham.enum_value == 0x10000000000 +def test_annotation_attribute(): + tu = get_tu('int foo (void) __attribute__ ((annotate("here be annotation attribute")));') + + foo = get_cursor(tu, 'foo') + assert foo is not None + + for c in foo.get_children(): + if c.kind == CursorKind.ANNOTATE_ATTR: + assert c.displayname == "here be annotation attribute" + break + else: + assert False, "Couldn't find annotation" -- 1.7.9.5
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
