forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from Xilinx/bump_to_41fecca9
[AutoBump] Merge with 41fecca (Jun 14) (76)
- Loading branch information
Showing
1,070 changed files
with
26,686 additions
and
14,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import unittest | ||
|
||
from clang.cindex import ( | ||
CursorKind, | ||
TemplateArgumentKind, | ||
ExceptionSpecificationKind, | ||
AvailabilityKind, | ||
AccessSpecifier, | ||
TypeKind, | ||
RefQualifierKind, | ||
LinkageKind, | ||
TLSKind, | ||
StorageClass, | ||
) | ||
|
||
|
||
class TestCursorKind(unittest.TestCase): | ||
enums = [ | ||
CursorKind, | ||
TemplateArgumentKind, | ||
ExceptionSpecificationKind, | ||
AvailabilityKind, | ||
AccessSpecifier, | ||
TypeKind, | ||
RefQualifierKind, | ||
LinkageKind, | ||
TLSKind, | ||
StorageClass, | ||
] | ||
|
||
def test_from_id(self): | ||
"""Check that kinds can be constructed from valid IDs""" | ||
for enum in self.enums: | ||
self.assertEqual(enum.from_id(2), enum._kinds[2]) | ||
with self.assertRaises(ValueError): | ||
enum.from_id(len(enum._kinds)) | ||
with self.assertRaises(ValueError): | ||
enum.from_id(-1) | ||
|
||
def test_unique_kinds(self): | ||
"""Check that no kind name has been used multiple times""" | ||
for enum in self.enums: | ||
for id in range(len(enum._kinds)): | ||
try: | ||
enum.from_id(id).name | ||
except ValueError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.