Skip to content

Commit

Permalink
test: test initialized enumerator documentation
Browse files Browse the repository at this point in the history
Also add it to examples.
  • Loading branch information
jnikula committed Aug 6, 2023
1 parent 52dc615 commit c9211b7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/c/autoenum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Enum doc.


.. c:enumerator:: bar
.. c:enumerator:: bar = 0
Enumeration comment.

4 changes: 2 additions & 2 deletions test/c/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum foo {
/**
* Enumeration comment.
*/
bar,
bar = 0,
/**
* Another.
*/
Expand All @@ -19,7 +19,7 @@ enum {
/**
* Enumeration comment.
*/
FOO,
FOO = 5,
/**
* Another.
*/
Expand Down
4 changes: 2 additions & 2 deletions test/c/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Enum doc.


.. c:enumerator:: bar
.. c:enumerator:: bar = 0
Enumeration comment.

Expand All @@ -19,7 +19,7 @@
Anonymous enum.


.. c:enumerator:: FOO
.. c:enumerator:: FOO = 5
Enumeration comment.

Expand Down
2 changes: 1 addition & 1 deletion test/cpp/autoenum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Enum doc.


.. cpp:enumerator:: bar
.. cpp:enumerator:: bar = 0

Enumeration comment.

4 changes: 2 additions & 2 deletions test/cpp/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Enum doc.


.. cpp:enumerator:: bar
.. cpp:enumerator:: bar = 0

Enumeration comment.

Expand All @@ -19,7 +19,7 @@
Anonymous enum.


.. cpp:enumerator:: FOO
.. cpp:enumerator:: FOO = 5

Enumeration comment.

Expand Down
5 changes: 4 additions & 1 deletion test/examples/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ enum mode {
MODE_PRIMARY,
/**
* The secondary frobnication mode.
*
* If the enumerator is initialized in source, its value will also be
* included in documentation.
*/
MODE_SECONDARY,
MODE_SECONDARY = 2,
};
5 changes: 4 additions & 1 deletion test/examples/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
The primary frobnication mode.


.. c:enumerator:: MODE_SECONDARY
.. c:enumerator:: MODE_SECONDARY = 2
The secondary frobnication mode.

If the enumerator is initialized in source, its value will also be
included in documentation.

0 comments on commit c9211b7

Please sign in to comment.