summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/roots/test-domain-c/index.rst25
-rw-r--r--tests/test_domain_c.py24
2 files changed, 31 insertions, 18 deletions
diff --git a/tests/roots/test-domain-c/index.rst b/tests/roots/test-domain-c/index.rst
index e81f9c8e8..55e284692 100644
--- a/tests/roots/test-domain-c/index.rst
+++ b/tests/roots/test-domain-c/index.rst
@@ -7,11 +7,32 @@ directives
.. c:function:: int hello(char *name)
.. c:member:: float Sphinx.version
+.. c:var:: int version
.. c:macro:: IS_SPHINX
-
.. c:macro:: SPHINX(arg1, arg2)
+.. c:struct:: MyStruct
+.. c:union:: MyUnion
+.. c:enum:: MyEnum
+
+ .. c:enumerator:: MyEnumerator
+
+ :c:enumerator:`MyEnumerator`
+
+ :c:enumerator:`MyEnumerator`
+
+:c:enumerator:`MyEnumerator`
+
.. c:type:: Sphinx
+.. c:type:: int SphinxVersionNum
-.. c:var:: int version
+
+.. c:struct:: A
+
+ .. c:union:: @data
+
+ .. c:member:: int a
+
+- :c:member:`A.@data.a`
+- :c:member:`A.a`
diff --git a/tests/test_domain_c.py b/tests/test_domain_c.py
index efbf332b4..1c42ca967 100644
--- a/tests/test_domain_c.py
+++ b/tests/test_domain_c.py
@@ -246,9 +246,6 @@ def test_expressions():
def test_type_definitions():
check('type', "T", {1: "T"})
- check('type', "struct T", {1: 'T'})
- check('type', "enum T", {1: 'T'})
- check('type', "union T", {1: 'T'})
check('type', "bool *b", {1: 'b'})
check('type', "bool *const b", {1: 'b'})
@@ -301,9 +298,6 @@ def test_member_definitions():
check('member', 'restrict volatile const int a', {1: 'a'})
check('member', 'T t', {1: 't'})
- check('member', 'struct T t', {1: 't'})
- check('member', 'enum T t', {1: 't'})
- check('member', 'union T t', {1: 't'})
check('member', 'int a[]', {1: 'a'})
@@ -376,20 +370,18 @@ def test_function_definitions():
def test_union_definitions():
- return # TODO
- check('union', 'A', {2: "1A"})
+ check('struct', 'A', {1: 'A'})
+
+
+def test_union_definitions():
+ check('union', 'A', {1: 'A'})
def test_enum_definitions():
- return # TODO
- check('enum', 'A', {2: "1A"})
- check('enum', 'A : std::underlying_type<B>::type', {2: "1A"})
- check('enum', 'A : unsigned int', {2: "1A"})
- check('enum', 'public A', {2: "1A"}, output='A')
- check('enum', 'private A', {2: "1A"})
+ check('enum', 'A', {1: 'A'})
- check('enumerator', 'A', {2: "1A"})
- check('enumerator', 'A = std::numeric_limits<unsigned long>::max()', {2: "1A"})
+ check('enumerator', 'A', {1: 'A'})
+ check('enumerator', 'A = 42', {1: 'A'})
def test_anon_definitions():