diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-06-08 08:38:12 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-06-08 08:38:12 +0000 |
commit | 416fa34b873f40393a2e52827e9ab2a12133a921 (patch) | |
tree | 144c566ff6d62526cce37a9feec3f45171514bbc /clang/unittests/Tooling | |
parent | 69186e731ffd95c3d3c2b70d36e306d109c92630 (diff) | |
download | bcm5719-llvm-416fa34b873f40393a2e52827e9ab2a12133a921.tar.gz bcm5719-llvm-416fa34b873f40393a2e52827e9ab2a12133a921.zip |
[C++11] Use 'nullptr'. Unittests edition.
llvm-svn: 210423
Diffstat (limited to 'clang/unittests/Tooling')
-rw-r--r-- | clang/unittests/Tooling/CommentHandlerTest.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Tooling/CompilationDatabaseTest.cpp | 6 | ||||
-rw-r--r-- | clang/unittests/Tooling/RefactoringTest.cpp | 4 | ||||
-rw-r--r-- | clang/unittests/Tooling/RewriterTestContext.h | 6 | ||||
-rw-r--r-- | clang/unittests/Tooling/ToolingTest.cpp | 6 |
5 files changed, 12 insertions, 12 deletions
diff --git a/clang/unittests/Tooling/CommentHandlerTest.cpp b/clang/unittests/Tooling/CommentHandlerTest.cpp index f0f7797d579..117dfc36feb 100644 --- a/clang/unittests/Tooling/CommentHandlerTest.cpp +++ b/clang/unittests/Tooling/CommentHandlerTest.cpp @@ -28,7 +28,7 @@ class CommentHandlerVisitor : public TestVisitor<CommentHandlerVisitor>, typedef TestVisitor<CommentHandlerVisitor> base; public: - CommentHandlerVisitor() : base(), PP(0), Verified(false) { } + CommentHandlerVisitor() : base(), PP(nullptr), Verified(false) {} ~CommentHandlerVisitor() { EXPECT_TRUE(Verified) << "CommentVerifier not accessed"; diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp index 9f078f41033..8866e751fcf 100644 --- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp +++ b/clang/unittests/Tooling/CompilationDatabaseTest.cpp @@ -22,8 +22,8 @@ namespace tooling { static void expectFailure(StringRef JSONDatabase, StringRef Explanation) { std::string ErrorMessage; - EXPECT_EQ(NULL, JSONCompilationDatabase::loadFromBuffer(JSONDatabase, - ErrorMessage)) + EXPECT_EQ(nullptr, JSONCompilationDatabase::loadFromBuffer(JSONDatabase, + ErrorMessage)) << "Expected an error because of: " << Explanation.str(); } @@ -434,7 +434,7 @@ TEST(FixedCompilationDatabase, GetAllCompileCommands) { TEST(ParseFixedCompilationDatabase, ReturnsNullOnEmptyArgumentList) { int Argc = 0; std::unique_ptr<FixedCompilationDatabase> Database( - FixedCompilationDatabase::loadFromCommandLine(Argc, NULL)); + FixedCompilationDatabase::loadFromCommandLine(Argc, nullptr)); EXPECT_FALSE(Database); EXPECT_EQ(0, Argc); } diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index b1ed3c72be8..d600880efbe 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -236,7 +236,7 @@ public: OutStream << Content; OutStream.close(); const FileEntry *File = Context.Files.getFile(Path); - assert(File != NULL); + assert(File != nullptr); StringRef Found = TemporaryFiles.GetOrCreateValue(Name, Path.str()).second; assert(Found == Path); @@ -253,7 +253,7 @@ public: // FIXME: Figure out whether there is a way to get the SourceManger to // reopen the file. std::unique_ptr<const llvm::MemoryBuffer> FileBuffer( - Context.Files.getBufferForFile(Path, NULL)); + Context.Files.getBufferForFile(Path, nullptr)); return FileBuffer->getBuffer(); } diff --git a/clang/unittests/Tooling/RewriterTestContext.h b/clang/unittests/Tooling/RewriterTestContext.h index f02ba1a9ffb..6353cec5962 100644 --- a/clang/unittests/Tooling/RewriterTestContext.h +++ b/clang/unittests/Tooling/RewriterTestContext.h @@ -53,7 +53,7 @@ class RewriterTestContext { const FileEntry *Entry = Files.getVirtualFile(Name, Source->getBufferSize(), 0); Sources.overrideFileContents(Entry, Source); - assert(Entry != NULL); + assert(Entry != nullptr); return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User); } @@ -71,7 +71,7 @@ class RewriterTestContext { OutStream << Content; OutStream.close(); const FileEntry *File = Files.getFile(Path); - assert(File != NULL); + assert(File != nullptr); StringRef Found = TemporaryFiles.GetOrCreateValue(Name, Path.str()).second; assert(Found == Path); @@ -103,7 +103,7 @@ class RewriterTestContext { // FIXME: Figure out whether there is a way to get the SourceManger to // reopen the file. std::unique_ptr<const llvm::MemoryBuffer> FileBuffer( - Files.getBufferForFile(Path, NULL)); + Files.getBufferForFile(Path, nullptr)); return FileBuffer->getBuffer(); } diff --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp index f277728ea89..2b57c16ac52 100644 --- a/clang/unittests/Tooling/ToolingTest.cpp +++ b/clang/unittests/Tooling/ToolingTest.cpp @@ -121,12 +121,12 @@ TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromType) { std::unique_ptr<FrontendActionFactory> Factory( newFrontendActionFactory<SyntaxOnlyAction>()); std::unique_ptr<FrontendAction> Action(Factory->create()); - EXPECT_TRUE(Action.get() != NULL); + EXPECT_TRUE(Action.get() != nullptr); } struct IndependentFrontendActionCreator { ASTConsumer *newASTConsumer() { - return new FindTopLevelDeclConsumer(NULL); + return new FindTopLevelDeclConsumer(nullptr); } }; @@ -135,7 +135,7 @@ TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromFactoryType) { std::unique_ptr<FrontendActionFactory> Factory( newFrontendActionFactory(&Creator)); std::unique_ptr<FrontendAction> Action(Factory->create()); - EXPECT_TRUE(Action.get() != NULL); + EXPECT_TRUE(Action.get() != nullptr); } TEST(ToolInvocation, TestMapVirtualFile) { |