aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-06 12:18:01 -0500
committerJack Lloyd <[email protected]>2017-01-06 12:18:01 -0500
commit963811ea2dc1884b305d1619f42edc9da0405fd2 (patch)
treea4b60a8e14fb8bdccd0fcc30fb461c34984bdd06
parent13c7c64da3c474504f2e92850111bceefd169029 (diff)
Another try/catch for the tests
-rw-r--r--src/tests/test_pkcs11_low_level.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/tests/test_pkcs11_low_level.cpp b/src/tests/test_pkcs11_low_level.cpp
index feb490cd4..289ff5995 100644
--- a/src/tests/test_pkcs11_low_level.cpp
+++ b/src/tests/test_pkcs11_low_level.cpp
@@ -49,18 +49,23 @@ class RAII_LowLevel
}
~RAII_LowLevel() BOTAN_NOEXCEPT
{
-
- if(m_is_session_open)
+ try
{
- if(m_is_logged_in)
+ if(m_is_session_open)
{
- m_low_level.get()->C_Logout(m_session_handle, nullptr);
- }
+ if(m_is_logged_in)
+ {
+ m_low_level.get()->C_Logout(m_session_handle, nullptr);
+ }
- m_low_level.get()->C_CloseSession(m_session_handle, nullptr);
+ m_low_level.get()->C_CloseSession(m_session_handle, nullptr);
+ }
+ m_low_level.get()->C_Finalize(nullptr, nullptr);
+ }
+ catch(...)
+ {
+ // ignore errors here
}
-
- m_low_level.get()->C_Finalize(nullptr, nullptr);
}
std::vector<SlotId> get_slots(bool token_present) const