From 80aa766067cf6da9c40ddda645d60211fd098a3d Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 8 Sep 2010 17:12:42 +0100 Subject: [PATCH] Improve error reporting in test suites Before running each test case clear the thread local error indicator. After running each test case, dispatch any error that was reported * tests/testutils.c: Fix error reporting in test suites --- tests/testutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testutils.c b/tests/testutils.c index 8171f103b6..70e7538f77 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -124,8 +124,12 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const if (ts) GETTIMEOFDAY(&before); + virResetLastError(); if ((ret = body(data)) != 0) break; + virErrorPtr err = virGetLastError(); + if (err) + virDispatchError(NULL); if (ts) { GETTIMEOFDAY(&after); ts[i] = DIFF_MSEC(&after, &before);