10#include <gtest/gtest.h>
24#define EXPECT_THROW_MSG(statement,etype,emsg) \
28 ADD_FAILURE() << "no exception, expected: " << #etype; \
29 } catch (const etype& ex) { \
30 EXPECT_EQ(std::string(ex.what()), emsg); \
32 ADD_FAILURE() << "wrong exception type thrown, expected: " << #etype; \
45#define ASSERT_THROW_MSG(statement,etype,emsg) \
49 GTEST_FAIL() << "no exception, expected: " << #etype; \
50 } catch (const etype& ex) { \
51 ASSERT_EQ(std::string(ex.what()), emsg); \
53 GTEST_FAIL() << "wrong exception type thrown, expected: " << #etype; \
61#define EXPECT_NO_THROW_LOG(statement) \
65 } catch (const std::exception& ex) { \
66 ADD_FAILURE() << #statement << " threw type: " << typeid(ex).name() \
67 << ", what: " << ex.what(); \
69 ADD_FAILURE() << #statement << "threw non-std::exception"; \
77#define ASSERT_NO_THROW_LOG(statement) \
81 } catch (const std::exception& ex) { \
82 GTEST_FAIL() << #statement << " threw type: " << typeid(ex).name() \
83 << ", what: " << ex.what(); \
85 GTEST_FAIL() << #statement << " threw non-std::exception"; \
101#define SKIP_IF(expression) \
104 auto const info = ::testing::UnitTest::GetInstance()->current_test_info(); \
105 std::cerr << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
106 << ": '" << #expression << "' is true" << std::endl; \
111#define SKIP_IF(expression) \
114 auto const info = ::testing::UnitTest::GetInstance()->current_test_info(); \
115 GTEST_SKIP() << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
116 << ": '" << #expression << "' is true"; \
Defines the logger used by the top-level component of kea-lfc.