summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/CompilationDatabaseTest.cpp
diff options
context:
space:
mode:
authorAhmed Charles <ahmedcharles@gmail.com>2014-03-07 20:03:18 +0000
committerAhmed Charles <ahmedcharles@gmail.com>2014-03-07 20:03:18 +0000
commitb89843299a118d9f97774f35e59f9b541ef5e284 (patch)
treeee6366d2f652d2475d52f6ea9b4fbbc64dc2647e /clang/unittests/Tooling/CompilationDatabaseTest.cpp
parent629afaefe0cd1a583ccee54918b7b13f48bfe273 (diff)
downloadbcm5719-llvm-b89843299a118d9f97774f35e59f9b541ef5e284.tar.gz
bcm5719-llvm-b89843299a118d9f97774f35e59f9b541ef5e284.zip
Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r--clang/unittests/Tooling/CompilationDatabaseTest.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
index 9260e621b38..9f078f41033 100644
--- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp
+++ b/clang/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 =
OpenPOWER on IntegriCloud