diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-10 20:47:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-11 11:20:43 +0200 |
commit | 2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch) | |
tree | b0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /unotest | |
parent | 74012c48d99634a7556a86f77e9522024f2afdb2 (diff) |
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotest')
-rw-r--r-- | unotest/source/cpp/officeconnection.cxx | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx index 7a15161031e5..fbd63f385abe 100644 --- a/unotest/source/cpp/officeconnection.cxx +++ b/unotest/source/cpp/officeconnection.cxx @@ -110,27 +110,28 @@ void OfficeConnection::setUp() { } void OfficeConnection::tearDown() { - if (process_ != nullptr) { - if (context_.is()) { - css::uno::Reference< css::frame::XDesktop2 > desktop = css::frame::Desktop::create( context_ ); - context_.clear(); - try { - CPPUNIT_ASSERT(desktop->terminate()); - desktop.clear(); - } catch (css::lang::DisposedException &) {} - // it appears that DisposedExceptions can already happen while - // receiving the response of the terminate call - } - CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, osl_joinProcess(process_)); - oslProcessInfo info; - info.Size = sizeof info; - CPPUNIT_ASSERT_EQUAL( - osl_Process_E_None, - osl_getProcessInfo(process_, osl_Process_EXITCODE, &info)); - CPPUNIT_ASSERT_EQUAL(oslProcessExitCode(0), info.Code); - osl_freeProcessHandle(process_); - process_ = nullptr; // guard against subsequent calls to isStillAlive + if (process_ == nullptr) + return; + + if (context_.is()) { + css::uno::Reference< css::frame::XDesktop2 > desktop = css::frame::Desktop::create( context_ ); + context_.clear(); + try { + CPPUNIT_ASSERT(desktop->terminate()); + desktop.clear(); + } catch (css::lang::DisposedException &) {} + // it appears that DisposedExceptions can already happen while + // receiving the response of the terminate call } + CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, osl_joinProcess(process_)); + oslProcessInfo info; + info.Size = sizeof info; + CPPUNIT_ASSERT_EQUAL( + osl_Process_E_None, + osl_getProcessInfo(process_, osl_Process_EXITCODE, &info)); + CPPUNIT_ASSERT_EQUAL(oslProcessExitCode(0), info.Code); + osl_freeProcessHandle(process_); + process_ = nullptr; // guard against subsequent calls to isStillAlive } |