|
@@ -66,14 +66,14 @@ TEST(LoggingTest, parsingConsoleOutput) {
|
|
|
|
|
|
EXPECT_NO_THROW(parser.parseConfiguration(config));
|
|
|
|
|
|
- ASSERT_EQ(1, storage->logging_info_.size());
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo().size());
|
|
|
|
|
|
- EXPECT_EQ("kea", storage->logging_info_[0].name_);
|
|
|
- EXPECT_EQ(99, storage->logging_info_[0].debuglevel_);
|
|
|
- EXPECT_EQ(isc::log::DEBUG, storage->logging_info_[0].severity_);
|
|
|
+ EXPECT_EQ("kea", storage->getLoggingInfo()[0].name_);
|
|
|
+ EXPECT_EQ(99, storage->getLoggingInfo()[0].debuglevel_);
|
|
|
+ EXPECT_EQ(isc::log::DEBUG, storage->getLoggingInfo()[0].severity_);
|
|
|
|
|
|
- ASSERT_EQ(1, storage->logging_info_[0].destinations_.size());
|
|
|
- EXPECT_EQ("stdout" , storage->logging_info_[0].destinations_[0].output_);
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo()[0].destinations_.size());
|
|
|
+ EXPECT_EQ("stdout" , storage->getLoggingInfo()[0].destinations_[0].output_);
|
|
|
}
|
|
|
|
|
|
// Checks if the LogConfigParser class is able to transform JSON structures
|
|
@@ -106,14 +106,14 @@ TEST(LoggingTest, parsingFile) {
|
|
|
|
|
|
EXPECT_NO_THROW(parser.parseConfiguration(config));
|
|
|
|
|
|
- ASSERT_EQ(1, storage->logging_info_.size());
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo().size());
|
|
|
|
|
|
- EXPECT_EQ("kea", storage->logging_info_[0].name_);
|
|
|
- EXPECT_EQ(0, storage->logging_info_[0].debuglevel_);
|
|
|
- EXPECT_EQ(isc::log::INFO, storage->logging_info_[0].severity_);
|
|
|
+ EXPECT_EQ("kea", storage->getLoggingInfo()[0].name_);
|
|
|
+ EXPECT_EQ(0, storage->getLoggingInfo()[0].debuglevel_);
|
|
|
+ EXPECT_EQ(isc::log::INFO, storage->getLoggingInfo()[0].severity_);
|
|
|
|
|
|
- ASSERT_EQ(1, storage->logging_info_[0].destinations_.size());
|
|
|
- EXPECT_EQ("logfile.txt" , storage->logging_info_[0].destinations_[0].output_);
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo()[0].destinations_.size());
|
|
|
+ EXPECT_EQ("logfile.txt" , storage->getLoggingInfo()[0].destinations_[0].output_);
|
|
|
}
|
|
|
|
|
|
// Checks if the LogConfigParser class is able to transform data structures
|
|
@@ -156,19 +156,19 @@ TEST(LoggingTest, multipleLoggers) {
|
|
|
|
|
|
EXPECT_NO_THROW(parser.parseConfiguration(config));
|
|
|
|
|
|
- ASSERT_EQ(2, storage->logging_info_.size());
|
|
|
+ ASSERT_EQ(2, storage->getLoggingInfo().size());
|
|
|
|
|
|
- EXPECT_EQ("kea", storage->logging_info_[0].name_);
|
|
|
- EXPECT_EQ(0, storage->logging_info_[0].debuglevel_);
|
|
|
- EXPECT_EQ(isc::log::INFO, storage->logging_info_[0].severity_);
|
|
|
- ASSERT_EQ(1, storage->logging_info_[0].destinations_.size());
|
|
|
- EXPECT_EQ("logfile.txt" , storage->logging_info_[0].destinations_[0].output_);
|
|
|
+ EXPECT_EQ("kea", storage->getLoggingInfo()[0].name_);
|
|
|
+ EXPECT_EQ(0, storage->getLoggingInfo()[0].debuglevel_);
|
|
|
+ EXPECT_EQ(isc::log::INFO, storage->getLoggingInfo()[0].severity_);
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo()[0].destinations_.size());
|
|
|
+ EXPECT_EQ("logfile.txt" , storage->getLoggingInfo()[0].destinations_[0].output_);
|
|
|
|
|
|
- EXPECT_EQ("wombat", storage->logging_info_[1].name_);
|
|
|
- EXPECT_EQ(99, storage->logging_info_[1].debuglevel_);
|
|
|
- EXPECT_EQ(isc::log::DEBUG, storage->logging_info_[1].severity_);
|
|
|
- ASSERT_EQ(1, storage->logging_info_[1].destinations_.size());
|
|
|
- EXPECT_EQ("logfile2.txt" , storage->logging_info_[1].destinations_[0].output_);
|
|
|
+ EXPECT_EQ("wombat", storage->getLoggingInfo()[1].name_);
|
|
|
+ EXPECT_EQ(99, storage->getLoggingInfo()[1].debuglevel_);
|
|
|
+ EXPECT_EQ(isc::log::DEBUG, storage->getLoggingInfo()[1].severity_);
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo()[1].destinations_.size());
|
|
|
+ EXPECT_EQ("logfile2.txt" , storage->getLoggingInfo()[1].destinations_[0].output_);
|
|
|
}
|
|
|
|
|
|
// Checks if the LogConfigParser class is able to transform data structures
|
|
@@ -204,14 +204,14 @@ TEST(LoggingTest, multipleLoggingDestinations) {
|
|
|
|
|
|
EXPECT_NO_THROW(parser.parseConfiguration(config));
|
|
|
|
|
|
- ASSERT_EQ(1, storage->logging_info_.size());
|
|
|
+ ASSERT_EQ(1, storage->getLoggingInfo().size());
|
|
|
|
|
|
- EXPECT_EQ("kea", storage->logging_info_[0].name_);
|
|
|
- EXPECT_EQ(0, storage->logging_info_[0].debuglevel_);
|
|
|
- EXPECT_EQ(isc::log::INFO, storage->logging_info_[0].severity_);
|
|
|
- ASSERT_EQ(2, storage->logging_info_[0].destinations_.size());
|
|
|
- EXPECT_EQ("logfile.txt" , storage->logging_info_[0].destinations_[0].output_);
|
|
|
- EXPECT_EQ("stdout" , storage->logging_info_[0].destinations_[1].output_);
|
|
|
+ EXPECT_EQ("kea", storage->getLoggingInfo()[0].name_);
|
|
|
+ EXPECT_EQ(0, storage->getLoggingInfo()[0].debuglevel_);
|
|
|
+ EXPECT_EQ(isc::log::INFO, storage->getLoggingInfo()[0].severity_);
|
|
|
+ ASSERT_EQ(2, storage->getLoggingInfo()[0].destinations_.size());
|
|
|
+ EXPECT_EQ("logfile.txt" , storage->getLoggingInfo()[0].destinations_[0].output_);
|
|
|
+ EXPECT_EQ("stdout" , storage->getLoggingInfo()[0].destinations_[1].output_);
|
|
|
}
|
|
|
|
|
|
/// @todo There is no easy way to test applyConfiguration() and defaultLogging().
|