testing: avoid aborting client-test due to exception in destructor
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 10 Nov 2011 13:59:36 +0000 (14:59 +0100)
committerPatrick Ohly <patrick.ohly@intel.com>
Thu, 10 Nov 2011 13:59:36 +0000 (14:59 +0100)
commit919a45adef11f54b1dd4c28d1121a3438f7bfb02
tree53468bd5d5b508b648b68e4b69bb1afd269754c9
parent51471312a8b01115d9d7a1249c112acb6261b156
testing: avoid aborting client-test due to exception in destructor

The TestingSyncSource destructor ends up calling endSync() for
CalDAV/CardDAV, which must do some real work and may fail with an
exception. If the test has already failed and is getting left via
exception handling, then this extra work can be skipped and, more
importantly, no exceptions are allowed because they would terminate
client-test.

Happened in practice when Google becomes unresponsive with 401 errors,
because then the test fails and the reading of CTag in endSync() is
just going to encounter the same problem, thus raising a second
exception.
test/ClientTest.cpp