diff options
author | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-07 20:03:18 +0000 |
---|---|---|
committer | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-07 20:03:18 +0000 |
commit | 70639e8de3f7232504008ae36507eb0125093907 (patch) | |
tree | f909e5aea2fab1df90f2ecae3695c0acfeb45e8c /unittests/Tooling/CompilationDatabaseTest.cpp | |
parent | caabaa8e4b0d6d4534152852a3dfc69cfd386050 (diff) | |
download | clang-70639e8de3f7232504008ae36507eb0125093907.tar.gz clang-70639e8de3f7232504008ae36507eb0125093907.tar.bz2 clang-70639e8de3f7232504008ae36507eb0125093907.tar.xz |
Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r-- | unittests/Tooling/CompilationDatabaseTest.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/unittests/Tooling/CompilationDatabaseTest.cpp b/unittests/Tooling/CompilationDatabaseTest.cpp index 9260e621b3..9f078f4103 100644 --- a/unittests/Tooling/CompilationDatabaseTest.cpp +++ b/unittests/Tooling/CompilationDatabaseTest.cpp @@ -42,7 +42,7 @@ TEST(JSONCompilationDatabase, ErrsOnInvalidFormat) { static std::vector<std::string> getAllFiles(StringRef JSONDatabase, std::string &ErrorMessage) { - OwningPtr<CompilationDatabase> Database( + std::unique_ptr<CompilationDatabase> Database( JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage)); if (!Database) { ADD_FAILURE() << ErrorMessage; @@ -53,7 +53,7 @@ static std::vector<std::string> getAllFiles(StringRef JSONDatabase, static std::vector<CompileCommand> getAllCompileCommands(StringRef JSONDatabase, std::string &ErrorMessage) { - OwningPtr<CompilationDatabase> Database( + std::unique_ptr<CompilationDatabase> Database( JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage)); if (!Database) { ADD_FAILURE() << ErrorMessage; @@ -115,7 +115,7 @@ TEST(JSONCompilationDatabase, GetAllCompileCommands) { static CompileCommand findCompileArgsInJsonDatabase(StringRef FileName, StringRef JSONDatabase, std::string &ErrorMessage) { - OwningPtr<CompilationDatabase> Database( + std::unique_ptr<CompilationDatabase> Database( JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage)); if (!Database) return CompileCommand(); @@ -433,7 +433,7 @@ TEST(FixedCompilationDatabase, GetAllCompileCommands) { TEST(ParseFixedCompilationDatabase, ReturnsNullOnEmptyArgumentList) { int Argc = 0; - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, NULL)); EXPECT_FALSE(Database); EXPECT_EQ(0, Argc); @@ -442,7 +442,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsNullOnEmptyArgumentList) { TEST(ParseFixedCompilationDatabase, ReturnsNullWithoutDoubleDash) { int Argc = 2; const char *Argv[] = { "1", "2" }; - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, Argv)); EXPECT_FALSE(Database); EXPECT_EQ(2, Argc); @@ -453,7 +453,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsArgumentsAfterDoubleDash) { const char *Argv[] = { "1", "2", "--\0no-constant-folding", "-DDEF3", "-DDEF4" }; - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, Argv)); ASSERT_TRUE((bool)Database); std::vector<CompileCommand> Result = @@ -472,7 +472,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsArgumentsAfterDoubleDash) { TEST(ParseFixedCompilationDatabase, ReturnsEmptyCommandLine) { int Argc = 3; const char *Argv[] = { "1", "2", "--\0no-constant-folding" }; - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, Argv)); ASSERT_TRUE((bool)Database); std::vector<CompileCommand> Result = @@ -489,7 +489,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsEmptyCommandLine) { TEST(ParseFixedCompilationDatabase, HandlesPositionalArgs) { const char *Argv[] = {"1", "2", "--", "-c", "somefile.cpp", "-DDEF3"}; int Argc = sizeof(Argv) / sizeof(char*); - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, Argv)); ASSERT_TRUE((bool)Database); std::vector<CompileCommand> Result = @@ -508,7 +508,7 @@ TEST(ParseFixedCompilationDatabase, HandlesPositionalArgs) { TEST(ParseFixedCompilationDatabase, HandlesArgv0) { const char *Argv[] = {"1", "2", "--", "mytool", "somefile.cpp"}; int Argc = sizeof(Argv) / sizeof(char*); - OwningPtr<FixedCompilationDatabase> Database( + std::unique_ptr<FixedCompilationDatabase> Database( FixedCompilationDatabase::loadFromCommandLine(Argc, Argv)); ASSERT_TRUE((bool)Database); std::vector<CompileCommand> Result = |