Skip to content

Commit

Permalink
test: extend function-like macro tests with variadic macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jnikula committed Apr 2, 2024
1 parent 983eb4f commit 419705c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/c/function-like-macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@
* Another
*/
#define BAR() yeah

/**
* Standard vararg.
*/
#define VARARG0(...) __VA_ARGS__

/**
* Named argument and standard varargs.
*/
#define VARARG1(par0, ...) __VA_ARGS__

/**
* Named varargs.
*/
#define VARARG0_NAMED(named...) named

/**
* Named argument and named varargs.
*/
#define VARARG1_NAMED(par0, named...) named
20 changes: 20 additions & 0 deletions test/c/function-like-macro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@
Another


.. c:macro:: VARARG0(...)
Standard vararg.


.. c:macro:: VARARG1(par0, ...)
Named argument and standard varargs.


.. c:macro:: VARARG0_NAMED(named...)
Named varargs.


.. c:macro:: VARARG1_NAMED(par0, named...)
Named argument and named varargs.

20 changes: 20 additions & 0 deletions test/cpp/function-like-macro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@
Another


.. c:macro:: VARARG0(...)
Standard vararg.


.. c:macro:: VARARG1(par0, ...)
Named argument and standard varargs.


.. c:macro:: VARARG0_NAMED(named...)
Named varargs.


.. c:macro:: VARARG1_NAMED(par0, named...)
Named argument and named varargs.

0 comments on commit 419705c

Please sign in to comment.