]> granicus.if.org Git - clang/commitdiff
[python] Add testcase for enum with specified underlaying type
authorAnders Waldenborg <anders@0x63.nu>
Wed, 2 May 2012 19:39:46 +0000 (19:39 +0000)
committerAnders Waldenborg <anders@0x63.nu>
Wed, 2 May 2012 19:39:46 +0000 (19:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156009 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/python/tests/cindex/test_cursor.py

index 9f02bb2a7686358830e52e54d180fe96765d5b21..5e8d1dc5dbcea2fe9d6d2c869f7ccb77d6998f65 100644 (file)
@@ -84,6 +84,14 @@ def test_enum_type():
     enum_type = enum.enum_type
     assert enum_type.kind == TypeKind.UINT
 
+def test_enum_type_cpp():
+    tu = get_tu('enum TEST : long long { FOO=1, BAR=2 };', lang="cpp")
+    enum = get_cursor(tu, 'TEST')
+    assert enum is not None
+
+    assert enum.kind == CursorKind.ENUM_DECL
+    assert enum.enum_type.kind == TypeKind.LONGLONG
+
 def test_objc_type_encoding():
     tu = get_tu('int i;', lang='objc')
     i = get_cursor(tu, 'i')