提交 b2399b06 编写于 作者: C Cole Robinson

tests: Fix dispatching internal error reports

Without this fix, the test suite doesn't print error messages when a libvirt
function fails. Additionally, only print error reports if DEBUG or VERBOSE
requested.
上级 149c4921
......@@ -126,13 +126,20 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
if (ts)
GETTIMEOFDAY(&before);
virResetLastError();
if ((ret = body(data)) != 0)
break;
ret = body(data);
virErrorPtr err = virGetLastError();
if (err)
virDispatchError(NULL);
if (ts) {
if (err) {
if (virTestGetVerbose() || virTestGetDebug())
virDispatchError(NULL);
}
if (ret != 0) {
break;
}
if (ts) {
GETTIMEOFDAY(&after);
ts[i] = DIFF_MSEC(&after, &before);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册