From: Vladimír Vondruš Date: Wed, 6 Dec 2017 13:02:57 +0000 (+0100) Subject: doxygen: test case for problematic \snippet call. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=192becca107fa758b0a6dc7e11ef86258fa13951;p=blog.git doxygen: test case for problematic \snippet call. Somehow Doxygen is not wrapping \snippet in a paragraph, which causes the inline code detection to fail. --- diff --git a/doxygen/test/contents_code/Doxyfile b/doxygen/test/contents_code/Doxyfile index d8d89a97..60356fdc 100644 --- a/doxygen/test/contents_code/Doxyfile +++ b/doxygen/test/contents_code/Doxyfile @@ -1,4 +1,5 @@ INPUT = input.dox +EXAMPLE_PATH = . QUIET = YES GENERATE_HTML = NO GENERATE_LATEX = NO diff --git a/doxygen/test/contents_code/index.html b/doxygen/test/contents_code/index.html index 9aec3671..d0515d80 100644 --- a/doxygen/test/contents_code/index.html +++ b/doxygen/test/contents_code/index.html @@ -42,7 +42,9 @@ // a block // that is indented // but has a lot of trailing whitespace which should be removed -} +}

Look:

void foo() { return; }

A paragraph following a one line snippet should not be merged with it.

void foo() { return; }

This one also not.

#include <cmath>
+
+void bar() { return; }

And this should not produce a warning.

Another paragraph.

diff --git a/doxygen/test/contents_code/input.dox b/doxygen/test/contents_code/input.dox index cb1a9d80..c85d051a 100644 --- a/doxygen/test/contents_code/input.dox +++ b/doxygen/test/contents_code/input.dox @@ -28,6 +28,23 @@ But not when it is in (@code{.js} alert('www'); @endcode) parentheses. @endcode + +Look: + +@snippet snippet.cpp 0 + +A paragraph following a one line snippet should not be merged with it. + +@snippet snippet.cpp 0 +

+ +This one also not. + +@snippet snippet.cpp 1 + +And this should not produce a warning. + +Another paragraph. */ /** @page warnings Code that produces warnings diff --git a/doxygen/test/contents_code/snippet.cpp b/doxygen/test/contents_code/snippet.cpp new file mode 100644 index 00000000..a39068e7 --- /dev/null +++ b/doxygen/test/contents_code/snippet.cpp @@ -0,0 +1,9 @@ +/** [0] */ +void foo() { return; } +/** [0] */ + +/** [1] */ +#include + +void bar() { return; } +/** [1] */