diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-05-13 16:37:29 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-05-14 09:49:47 +0200 |
commit | 5364f88463bca65cd7ba1a1f48f6c444586957eb (patch) | |
tree | baf98dd18a626ffa21d64f23632e0ab6fee6c607 /tests | |
parent | b15b6b115073b98d65254d16671a77f45e55293c (diff) |
qdoc: QML parser: Fix parsing of function parameters
The parameter name was passed incorrectly as the default value, and
the default value was not retrieved.
Pick-to: 5.15
Fixes: QTBUG-84089
Change-Id: I9f35702b431da3e58a8cb422f0b41475dd99f604
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests')
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml index 23ad2c40c..7a8c9386b 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml @@ -88,5 +88,17 @@ <db:para>Fails the current test case, with the optional <db:code role="parameter">message</db:code>.</db:para> <db:para>This method was introduced in QDoc.Test 1.0.</db:para> </db:section> +<db:section xml:id="fail_hard-method"> +<db:title>fail_hard(<db:emphasis>msg</db:emphasis> = "facepalm", <db:emphasis>option</db:emphasis> = 123)</db:title> +<db:para>Fails the current test case, hard.</db:para> +<db:itemizedlist> +<db:listitem> +<db:para>Prints out <db:code role="parameter">msg</db:code>.</db:para> +</db:listitem> +<db:listitem> +<db:para>Accepts a random <db:code role="parameter">option</db:code>.</db:para> +</db:listitem> +</db:itemizedlist> +</db:section> </db:section> </db:article> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html index 29ee16b1f..bdee999d1 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html @@ -43,6 +43,7 @@ <h2 id="methods">Methods</h2> <ul> <li class="fn"><b><b><a href="qml-qdoc-test-doctest.html#fail-method">fail</a></b></b>(<i>message</i>)</li> +<li class="fn"><b><b><a href="qml-qdoc-test-doctest.html#fail_hard-method">fail_hard</a></b></b>(<i>msg</i>, <i>option</i>)</li> </ul> <!-- $$$DocTest-description --> <a name="details"></a> @@ -111,5 +112,19 @@ <p>This method was introduced in QDoc.Test 1.0.</p> </div></div><!-- @@@fail --> <br/> +<!-- $$$fail_hard[overload1]$$$fail_hard --> +<div class="qmlitem"><div class="qmlproto"> +<div class="table"><table class="qmlname"> +<tr valign="top" class="odd" id="fail_hard-method"> +<td class="tblQmlFuncNode"><p> +<a name="fail_hard-method"></a><span class="name">fail_hard</span>(<i>msg</i> = "facepalm", <i>option</i> = 123)</p></td></tr> +</table></div></div> +<div class="qmldoc"><p>Fails the current test case, hard.</p> +<ul> +<li>Prints out <i>msg</i>.</li> +<li>Accepts a random <i>option</i>.</li> +</ul> +</div></div><!-- @@@fail_hard --> +<br/> </body> </html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index 5f0d0d8cd..2ec5e8159 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -79,6 +79,7 @@ <keyword name="disable" id="Type::disable" ref="qml-qdoc-test-type.html#disable-method"/> <keyword name="enable" id="Type::enable" ref="qml-qdoc-test-type.html#enable-method"/> <keyword name="fail" id="DocTest::fail" ref="qml-qdoc-test-doctest.html#fail-method"/> + <keyword name="fail_hard" id="DocTest::fail_hard" ref="qml-qdoc-test-doctest.html#fail_hard-method"/> <keyword name="fifth" id="Type::fifth" ref="qml-qdoc-test-type.html#fifth-prop"/> <keyword name="foo" id="DocTest::foo" ref="qml-qdoc-test-doctest.html#foo-signal"/> <keyword name="fourth" id="Type::fourth" ref="qml-qdoc-test-type.html#fourth-prop"/> diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/DocTest.qml b/tests/auto/qdoc/generatedoutput/testdata/qml/DocTest.qml index 2e581335e..f9eeb49d1 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/DocTest.qml +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/DocTest.qml @@ -92,4 +92,14 @@ Item { if (msg === undefined) msg = ""; } + + /*! + \brief Fails the current test case, hard. + \list + \li Prints out \a msg. + \li Accepts a random \a option. + \endlist + */ + function fail_hard(msg = "facepalm", option = 123) { + } } |