Commit 601d7f01 authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac555] Don't automatically unlink temporary file after creation

parent ef8b3f32
......@@ -111,10 +111,6 @@ public:
//
// \return Temporary file name
std::string createTempFilename() {
// Get prefix. Note that in all copies, strncpy does not guarantee
// a null-terminated string, hence the explict setting of the last
// character to NULL.
string filename = TEMP_DIR + "/bind10_logger_manager_test_XXXXXX";
// Copy into writeable storage for the call to mkstemp
......@@ -128,7 +124,6 @@ public:
isc_throw(Exception, "Unable to obtain unique filename");
}
close(filenum);
unlink(tname.get());
return (string(tname.get()));
}
......@@ -199,6 +194,11 @@ TEST_F(LoggerManagerTest, FileLogger) {
// put in the file for a later comparison.
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
// check. This adds weight to the idea that the logger will not
// keep the file open.
......
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