diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
commit | 6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e (patch) | |
tree | d17c61ff9f3ae28224fbddac6d26bfc59e2cf755 /src/google/protobuf/compiler/command_line_interface_unittest.cc | |
parent | baca1a8a1aa180c42de6278d3b8286c4496c6a10 (diff) | |
download | protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.gz protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.bz2 protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.zip |
Down-integrate from internal code base.
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface_unittest.cc')
-rw-r--r-- | src/google/protobuf/compiler/command_line_interface_unittest.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index 5bc1fea9..6e1a204d 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -41,6 +41,9 @@ #include <unistd.h> #endif #include <memory> +#ifndef _SHARED_PTR_H +#include <google/protobuf/stubs/shared_ptr.h> +#endif #include <vector> #include <google/protobuf/descriptor.pb.h> @@ -48,6 +51,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/compiler/command_line_interface.h> #include <google/protobuf/compiler/code_generator.h> +#include <google/protobuf/testing/file.h> #include <google/protobuf/compiler/mock_code_generator.h> #include <google/protobuf/compiler/subprocess.h> #include <google/protobuf/io/printer.h> @@ -59,6 +63,7 @@ #include <google/protobuf/testing/googletest.h> #include <gtest/gtest.h> + namespace google { namespace protobuf { namespace compiler { @@ -77,6 +82,10 @@ namespace compiler { namespace { +bool FileExists(const string& path) { + return File::Exists(path); +} + class CommandLineInterfaceTest : public testing::Test { protected: virtual void SetUp(); @@ -226,7 +235,7 @@ void CommandLineInterfaceTest::SetUp() { // If the temp directory already exists, it must be left over from a // previous run. Delete it. - if (File::Exists(temp_directory_)) { + if (FileExists(temp_directory_)) { File::DeleteRecursively(temp_directory_, NULL, NULL); } @@ -335,7 +344,7 @@ void CommandLineInterfaceTest::CreateTempFile( string::size_type slash_pos = name.find_last_of('/'); if (slash_pos != string::npos) { string dir = name.substr(0, slash_pos); - if (!File::Exists(temp_directory_ + "/" + dir)) { + if (!FileExists(temp_directory_ + "/" + dir)) { GOOGLE_CHECK_OK(File::RecursivelyCreateDir(temp_directory_ + "/" + dir, 0777)); } |