Commit c58ee77e authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac555] Remove redundant test class from LoggerSpecification unit tests

... and correct error in previous commit.
parent 601d7f01
...@@ -186,6 +186,13 @@ TEST_F(LoggerManagerTest, FileLogger) { ...@@ -186,6 +186,13 @@ TEST_F(LoggerManagerTest, FileLogger) {
// Create a specification for the file logger and use the manager to // Create a specification for the file logger and use the manager to
// connect the "filelogger" logger to it. // connect the "filelogger" logger to it.
SpecificationForFileLogger file_spec; SpecificationForFileLogger file_spec;
// For the first test, we want to check that the file is created
// if it does not already exist. So delete the temporary file before
// logging the first message.
unlink(file_spec.getFileName().c_str());
// Set up the file appenders.
LoggerManager manager; LoggerManager manager;
manager.process(file_spec.getSpecification()); manager.process(file_spec.getSpecification());
...@@ -194,10 +201,6 @@ TEST_F(LoggerManagerTest, FileLogger) { ...@@ -194,10 +201,6 @@ TEST_F(LoggerManagerTest, FileLogger) {
// put in the file for a later comparison. // put in the file for a later comparison.
vector<MessageID> ids; vector<MessageID> ids;
{ {
// For the first test, we want to check that the file is created
// if it does not already exist. So delete the temporary file before
// logging the first message.
unlink(file_spec.getFileName());
// Scope-limit the logger to ensure it is destroyed after the brief // Scope-limit the logger to ensure it is destroyed after the brief
// check. This adds weight to the idea that the logger will not // check. This adds weight to the idea that the logger will not
......
...@@ -22,18 +22,8 @@ ...@@ -22,18 +22,8 @@
using namespace isc::log; using namespace isc::log;
using namespace std; using namespace std;
/// \brief LoggerSpecification Test
class LoggerSpecificationTest : public ::testing::Test {
public:
LoggerSpecificationTest()
{}
~LoggerSpecificationTest()
{}
};
// Check default initialization. // Check default initialization.
TEST_F(LoggerSpecificationTest, DefaultInitialization) { TEST(LoggerSpecificationTest, DefaultInitialization) {
LoggerSpecification spec; LoggerSpecification spec;
EXPECT_EQ(string(""), spec.getName()); EXPECT_EQ(string(""), spec.getName());
...@@ -44,7 +34,7 @@ TEST_F(LoggerSpecificationTest, DefaultInitialization) { ...@@ -44,7 +34,7 @@ TEST_F(LoggerSpecificationTest, DefaultInitialization) {
} }
// Non-default initialization // Non-default initialization
TEST_F(LoggerSpecificationTest, Initialization) { TEST(LoggerSpecificationTest, Initialization) {
LoggerSpecification spec("alpha", isc::log::ERROR, 42, true); LoggerSpecification spec("alpha", isc::log::ERROR, 42, true);
EXPECT_EQ(string("alpha"), spec.getName()); EXPECT_EQ(string("alpha"), spec.getName());
...@@ -55,7 +45,7 @@ TEST_F(LoggerSpecificationTest, Initialization) { ...@@ -55,7 +45,7 @@ TEST_F(LoggerSpecificationTest, Initialization) {
} }
// Get/Set tests // Get/Set tests
TEST_F(LoggerSpecificationTest, SetGet) { TEST(LoggerSpecificationTest, SetGet) {
LoggerSpecification spec; LoggerSpecification spec;
spec.setName("gamma"); spec.setName("gamma");
...@@ -75,7 +65,7 @@ TEST_F(LoggerSpecificationTest, SetGet) { ...@@ -75,7 +65,7 @@ TEST_F(LoggerSpecificationTest, SetGet) {
} }
// Check option setting // Check option setting
TEST_F(LoggerSpecificationTest, AddOption) { TEST(LoggerSpecificationTest, AddOption) {
OutputOption option1; OutputOption option1;
option1.destination = OutputOption::DEST_FILE; option1.destination = OutputOption::DEST_FILE;
option1.filename = "/tmp/example.log"; option1.filename = "/tmp/example.log";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment