llvm-project/clang-tools-extra/unittests/clangd
Marc-Andre Laperle 90a937e3e1 [clangd] Use operator<< to prevent printers issues in Gtest
Summary:
It is possible that there will be two different instantiations of
the printer template for a given type and some tests could end up calling the
wrong (default) one. For example, it was seen in CodeCompleteTests.cpp when
printing CompletionItems that it would use the wrong printer because the default
is also instantiated in ClangdTests.cpp.

With this change, objects that were previously printed with a custom Printer now
get printed through the operator<< which is declared alongside the class.
This rule of the thumb should make it less error-prone.

Reviewers: simark, ilya-biryukov, sammccall

Reviewed By: simark, ilya-biryukov, sammccall

Subscribers: bkramer, hokein, sammccall, klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits

Differential Revision: https://reviews.llvm.org/D44764

llvm-svn: 329725
2018-04-10 17:34:46 +00:00
..
Annotations.cpp Make positionToOffset return llvm::Expected<size_t> 2018-03-21 14:36:46 +00:00
Annotations.h [clangd] Update include guard in Annotations.h. NFC 2018-02-08 12:46:34 +00:00
CMakeLists.txt [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
ClangdTests.cpp [clangd] Allow using customized include path in URI. 2018-04-09 15:09:44 +00:00
ClangdUnitTests.cpp [clangd] synthesize fix message when the diagnostic doesn't provide one. 2018-04-03 17:35:57 +00:00
CodeCompleteTests.cpp [clangd] Use operator<< to prevent printers issues in Gtest 2018-04-10 17:34:46 +00:00
CodeCompletionStringsTests.cpp [clangd] Pull CodeCompletionString handling logic into its own file and add unit test. 2017-12-20 17:24:31 +00:00
ContextTests.cpp [clangd] Introduced a Context that stores implicit data 2017-12-12 11:16:45 +00:00
DraftStoreTests.cpp [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
FileIndexTests.cpp [clangd] Not collect include headers for dynamic index for now. 2018-02-22 10:14:05 +00:00
FuzzyMatchTests.cpp [clangd] Address missed comments from D44003 2018-03-06 14:30:07 +00:00
HeadersTests.cpp [clangd] Remove Tagged and some related APIs from ClangdServer. 2018-03-12 23:22:35 +00:00
IndexTests.cpp [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex. 2018-03-14 09:48:05 +00:00
JSONExprTests.cpp [clangd] Use operator<< to prevent printers issues in Gtest 2018-04-10 17:34:46 +00:00
Matchers.h [clangd] Fix crash when CompilerInvocation can't be created. 2018-02-09 13:51:57 +00:00
SourceCodeTests.cpp Make positionToOffset return llvm::Expected<size_t> 2018-03-21 14:36:46 +00:00
SymbolCollectorTests.cpp s/LLVM_ON_WIN32/_WIN32/, clang-tools-extra 2018-04-10 13:14:03 +00:00
SyncAPI.cpp [clangd] Remove forceReparse, add a flag to addDocument instead 2018-03-14 17:08:41 +00:00
SyncAPI.h [clangd] Remove forceReparse, add a flag to addDocument instead 2018-03-14 17:08:41 +00:00
TUSchedulerTests.cpp [clangd] Don't expose vfs in TUScheduler::runWithPreamble. 2018-03-14 17:46:52 +00:00
TestFS.cpp s/LLVM_ON_WIN32/_WIN32/, clang-tools-extra 2018-04-10 13:14:03 +00:00
TestFS.h [clangd] Remove Tagged and some related APIs from ClangdServer. 2018-03-12 23:22:35 +00:00
TestScheme.h [clangd] Allow using customized include path in URI. 2018-04-09 15:09:44 +00:00
ThreadingTests.cpp [clangd] Tracing: name worker threads, and enforce naming scheduled async tasks 2018-02-19 09:56:28 +00:00
TraceTests.cpp Fix misuse of llvm::YAML in clangd test. 2018-03-23 19:16:07 +00:00
URITests.cpp s/LLVM_ON_WIN32/_WIN32/, clang-tools-extra 2018-04-10 13:14:03 +00:00
XRefsTests.cpp [clangd] Use operator<< to prevent printers issues in Gtest 2018-04-10 17:34:46 +00:00