在我的代码中有一些assert调用来确保我的函数正常工作,并对数据结构进行一些不变测试.
有时我在参数中使用函数,assert然后这个函数在该函数的Doxygens调用图中.对于一些更大的不变测试,这真的对图表进行了调查......
我怎样才能避免list_isSorted在调用图中出现以下片段?
int list_isElem (List l, Element e) {
assert(list_isSorted(l));
{
if (list_isEmpty(l)) { return 0; }
switch (compare(e, list_getValue(l))) {
case -1: return 0;
case 0: return 1;
case 1: return list_isElem (list_getTail(l), e);
default: exit(ERR_UNKNOWN);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试PREDEFINED = NDEBUG在Doxyfile中设置,但这不起作用.
只是跳过断言?
参见http://www.doxygen.nl/manual/faq.html
“最简单的新方法是在开头添加一个带有 \cond 命令的注释块,并在开头添加一个带有 \endcond 的注释块”
使用宏自动化它:
#define DAssert(x) /** \cond */ assert(x) /** \endcond */
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
217 次 |
| 最近记录: |