Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
601d7f01
Commit
601d7f01
authored
Jun 01, 2011
by
Stephen Morris
Browse files
[trac555] Don't automatically unlink temporary file after creation
parent
ef8b3f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/log/tests/logger_manager_unittest.cc
View file @
601d7f01
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment