From 42738e314155f40b68361bc07ac89fcfd5bfdc69 Mon Sep 17 00:00:00 2001 From: "sangwan.kwon" Date: Wed, 27 Jul 2016 16:11:52 +0900 Subject: Add exception handling on popup test Change-Id: I0194a82d728abe804eb214be52b001ded0b98723 Signed-off-by: sangwan.kwon --- tests/popup_test.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/popup_test.cpp b/tests/popup_test.cpp index ea4ba3a..44b5680 100644 --- a/tests/popup_test.cpp +++ b/tests/popup_test.cpp @@ -30,18 +30,27 @@ int main(int, char **) LogDebug("Cert-checker popup-test start!"); setlocale(LC_ALL, ""); - CCHECKER::app_t app( - std::string("test_APP_ID"), - std::string("test_PKG_ID"), - 5005, - {}); + try { + CCHECKER::app_t app( + std::string("test_APP_ID"), + std::string("test_PKG_ID"), + 5005, + {}); - CCHECKER::UI::PopupClient client; - // TODO(sangwan.kwon) Add boost TC for output FAIL, SUCCESS - if (client.dispatch(app)) - LogDebug("Success to launch popup."); - else - LogError("Failed to launch popup."); + CCHECKER::UI::PopupClient client; + // TODO(sangwan.kwon) Add boost TC for output FAIL, SUCCESS + if (client.dispatch(app)) + LogDebug("Success to launch popup."); + else + LogError("Failed to launch popup."); + + } catch (const std::exception &e) { + LogError("Exception occured in cert-checker test : " << e.what()); + return -1; + } catch (...) { + LogError("Unhandled exception occured in cert-checker test."); + return -1; + } LogDebug("Cert-checker popup-test exit!"); return 0; -- cgit v1.2.3