diff options
Diffstat (limited to 'tests/main.cpp')
-rw-r--r-- | tests/main.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index efaf1be8..c3ff1ebd 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -31,41 +31,47 @@ #include <exception.h> struct TestConfig { - TestConfig() { - boost::unit_test::unit_test_log.set_threshold_level( boost::unit_test::log_test_units); - boost::unit_test::results_reporter::set_level(boost::unit_test::SHORT_REPORT); - boost::unit_test::unit_test_log.set_formatter(new CKM::colour_log_formatter); - } - ~TestConfig(){ - } + TestConfig() + { + boost::unit_test::unit_test_log.set_threshold_level( + boost::unit_test::log_test_units); + boost::unit_test::results_reporter::set_level(boost::unit_test::SHORT_REPORT); + boost::unit_test::unit_test_log.set_formatter(new CKM::colour_log_formatter); + } + ~TestConfig() + { + } }; bool isLibInitialized = false; struct KeyProviderLib { - KeyProviderLib() { - try { - CKM::KeyProvider::initializeLibrary(); - isLibInitialized = true; - } catch (const CKM::Exc::Exception &) { - std::cout << "Library initialization failed!" << std::endl; - } - } - ~KeyProviderLib() { - try { - CKM::KeyProvider::closeLibrary(); - } catch (const CKM::Exc::Exception &) { - std::cout << "Library deinitialization failed!" << std::endl; - } - } + KeyProviderLib() + { + try { + CKM::KeyProvider::initializeLibrary(); + isLibInitialized = true; + } catch (const CKM::Exc::Exception &) { + std::cout << "Library initialization failed!" << std::endl; + } + } + ~KeyProviderLib() + { + try { + CKM::KeyProvider::closeLibrary(); + } catch (const CKM::Exc::Exception &) { + std::cout << "Library deinitialization failed!" << std::endl; + } + } }; struct LogSetup { - LogSetup() { - CKM::SetupClientLogSystem(); - CKM::Singleton<CKM::Log::LogSystem>::Instance().SetTag("CKM_INTERNAL_TESTS"); - } - ~LogSetup() {} + LogSetup() + { + CKM::SetupClientLogSystem(); + CKM::Singleton<CKM::Log::LogSystem>::Instance().SetTag("CKM_INTERNAL_TESTS"); + } + ~LogSetup() {} }; BOOST_GLOBAL_FIXTURE(KeyProviderLib) |