From 2b4257860046b3863b7c478d7f6ad5bdfcab757b Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 21 Dec 2018 20:44:21 +0100 Subject: Added test case for \ref, and fixed representation of operator->*() --- src/util.cpp | 4 +- testing/074/struct_foo.xml | 287 +++++++++++++++++++++++++++++++++++++++++++++ testing/074_ref.cpp | 49 ++++++++ 3 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 testing/074/struct_foo.xml create mode 100644 testing/074_ref.cpp diff --git a/src/util.cpp b/src/util.cpp index 1b6afa2..a05ca17 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1847,7 +1847,7 @@ QCString removeRedundantWhiteSpace(const QCString &s) case '*': if (i>0 && pc!=' ' && pc!='\t' && pc!=':' && pc!='*' && pc!='&' && pc!='(' && pc!='/' && - pc!='.' && (osp<9 || (pc=='>' && osp==11))) + pc!='.' && (osp<9 || !(pc=='>' && osp==11))) // avoid splitting &&, **, .*, operator*, operator->* { *dst++=' '; @@ -1930,7 +1930,7 @@ QCString removeRedundantWhiteSpace(const QCString &s) pc=c; } *dst++='\0'; - //printf("removeRedundantWhitespace(%s)->%s\n",s.data(),growBuf); + printf("removeRedundantWhitespace(%s)->%s\n",s.data(),growBuf); return growBuf; } diff --git a/testing/074/struct_foo.xml b/testing/074/struct_foo.xml new file mode 100644 index 0000000..56a497a --- /dev/null +++ b/testing/074/struct_foo.xml @@ -0,0 +1,287 @@ + + + + Foo + + + + Foo::Foo + () + Foo + + + + Constructor + + + + + + + Foo & + Foo& Foo::operator<< + (int i) + operator<< + + int + i + + + + + overloaded less than operator + + + + + + + const Foo & + const Foo& Foo::operator<< + (int i) const + operator<< + + int + i + + + + + overloaded const less than operator + + + + + + + int + int Foo::operator() + (int i) + operator() + + int + i + + + + + overloaded call operator + + + + + + + int + int Foo::operator() + (int i) const + operator() + + int + i + + + + + overloaded call operator + + + + + + + Foo & + Foo& Foo::operator&= + (const Foo &rhs) + operator&= + + const Foo & + rhs + + + + + and equal operator + + + + + + + Foo & + Foo& Foo::operator&= + (const Foo &rhs) + operator&= + + const Foo & + rhs + + + + + and equal operator + + + + + + + int * + int* Foo::operator->* + (int *p) + operator->* + + int * + p + + + + + Member pointer operator + + + + + + + + Foo + + Foo Foo::fun + () const + fun + + Fun with itself. + + + + + + + + + + + + Foo + + static Foo Foo::fun + (Foo a, Foo b) + fun + + + Foo + + a + + + + Foo + + b + + + Fun of two. + + + + + + + fun() const + + + + + fun() const + + + + + title + + + + + + + + + + + + Foo class. + + + + + Foo::Foo() constructor for details. + + + Foo constant. + + + less than operator. + + + const less than operator. + + + call operator. + + + const call operator. + + + and equal operator. + + + member pointer operator. + + + + + + + Foo + Foo + + + Foo + fun + + + Foo + fun + + + Foo + operator&= + + + Foo + operator&= + + + Foo + operator() + + + Foo + operator() + + + Foo + operator->* + + + Foo + operator<< + + + Foo + operator<< + + + + diff --git a/testing/074_ref.cpp b/testing/074_ref.cpp new file mode 100644 index 0000000..141e2b4 --- /dev/null +++ b/testing/074_ref.cpp @@ -0,0 +1,49 @@ +// objective: test \ref command in combination with const +// check: struct_foo.xml +/** @brief Foo class. + * + * @see @ref Foo::Foo() constructor for details. + * @see @ref Foo constant. + * @see @ref operator<<(int) "less than operator". + * @see @ref operator<<(int) const "const less than operator". + * @see @ref operator()(int) "call operator". + * @see @ref operator()(int) const "const call operator". + * @see @ref operator&=(const Foo&) "and equal operator". + * @see @ref operator->*(int *) "member pointer operator". + */ +struct Foo { + /** Constructor */ + Foo(); + /** + * @brief Fun of two + * + * - fun() const + * - @ref fun() const + * - @ref fun() const "title" + */ + static Foo fun(Foo a, Foo b); + + /** overloaded less than operator */ + Foo& operator<< (int i); + + /** overloaded const less than operator */ + const Foo& operator<< (int i) const; + + /** overloaded call operator */ + int operator()(int i); + + /** overloaded call operator */ + int operator()(int i) const; + + /** and equal operator */ + Foo& operator&=(const Foo& rhs); + + /** and equal operator */ + Foo& operator&=(const Foo& rhs); + + /** Member pointer operator */ + int* operator->*(int *p); + + /** @brief Fun with itself */ + Foo fun() const; +}; -- cgit v0.12