Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
baca1a8a
Commit
baca1a8a
authored
Nov 07, 2014
by
Feng Xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds more checks before deleting temporary files.
parent
ad7f41bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+2
-0
importer_unittest.cc
src/google/protobuf/compiler/importer_unittest.cc
+2
-0
file.cc
src/google/protobuf/testing/file.cc
+2
-0
No files found.
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
baca1a8a
...
...
@@ -252,7 +252,9 @@ void CommandLineInterfaceTest::SetUp() {
void
CommandLineInterfaceTest
::
TearDown
()
{
// Delete the temp directory.
if
(
File
::
Exists
(
temp_directory_
))
{
File
::
DeleteRecursively
(
temp_directory_
,
NULL
,
NULL
);
}
// Delete all the MockCodeGenerators.
for
(
int
i
=
0
;
i
<
mock_generators_to_delete_
.
size
();
i
++
)
{
...
...
src/google/protobuf/compiler/importer_unittest.cc
View file @
baca1a8a
...
...
@@ -348,9 +348,11 @@ class DiskSourceTreeTest : public testing::Test {
virtual
void
TearDown
()
{
for
(
int
i
=
0
;
i
<
dirnames_
.
size
();
i
++
)
{
if
(
File
::
Exists
(
dirnames_
[
i
]))
{
File
::
DeleteRecursively
(
dirnames_
[
i
],
NULL
,
NULL
);
}
}
}
void
AddFile
(
const
string
&
filename
,
const
char
*
contents
)
{
GOOGLE_CHECK_OK
(
File
::
SetContents
(
filename
,
contents
,
true
));
...
...
src/google/protobuf/testing/file.cc
View file @
baca1a8a
...
...
@@ -133,6 +133,8 @@ bool File::RecursivelyCreateDir(const string& path, int mode) {
void
File
::
DeleteRecursively
(
const
string
&
name
,
void
*
dummy1
,
void
*
dummy2
)
{
if
(
name
.
empty
())
return
;
// We don't care too much about error checking here since this is only used
// in tests to delete temporary directories that are under /tmp anyway.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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