llvm-project/clang/unittests/Format
Ben Hamilton 07e5836521 [clang-format] Fix regression when getStyle() called with empty filename
Summary:
D43522 caused an assertion failure when getStyle() was called with
an empty filename:

P8065

This adds a test to reproduce the failure and fixes the issue by
ensuring we never pass an empty filename to
Environment::CreateVirtualEnvironment().

Test Plan: New test added. Ran test with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
  Before diff, test failed with P8065. Now, test passes.

Reviewers: vsapsai, jolesiak, krasimir

Reviewed By: vsapsai

Subscribers: klimek, cfe-commits

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

llvm-svn: 325722
2018-02-21 21:27:27 +00:00
..
CMakeLists.txt [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CleanupTest.cpp Unittests misc. typos 2018-02-06 13:12:29 +00:00
FormatTest.cpp [clang-format] Fix regression when getStyle() called with empty filename 2018-02-21 21:27:27 +00:00
FormatTestComments.cpp Fix bug where we wouldn't break columns over the limit. 2017-12-04 08:53:16 +00:00
FormatTestJS.cpp clang-format: [JS] fix `of` detection. 2018-02-19 12:32:13 +00:00
FormatTestJava.cpp clang-format: Support formatting Java 8 interface default methods. 2018-01-23 16:30:56 +00:00
FormatTestObjC.cpp [clang-format] Improve ObjC headers detection 2018-02-15 08:47:56 +00:00
FormatTestProto.cpp [clang-format] Fixup a case of text proto message attributes 2018-02-19 15:31:25 +00:00
FormatTestRawStrings.cpp [clang-format] Adds space around angle brackets in text protos 2018-02-06 11:34:34 +00:00
FormatTestSelective.cpp [clang-format] Handle trailing comment sections in import statement lines 2017-05-19 10:34:57 +00:00
FormatTestTextProto.cpp [clang-format] Fix text proto extension scope opening detection 2018-02-19 16:00:21 +00:00
FormatTestUtils.h clang-format: Add preprocessor directive indentation 2017-08-30 14:34:57 +00:00
NamespaceEndCommentsFixerTest.cpp clang-format: fix block OpeningLineIndex around preprocessor 2017-07-28 07:56:14 +00:00
SortImportsTestJS.cpp clang-format: [JS] support default imports. 2017-08-01 15:54:43 +00:00
SortIncludesTest.cpp [clang-format] Add option to group multiple #include blocks when sorting includes 2017-11-27 13:23:45 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] Deduplicate using declarations 2017-11-24 18:00:01 +00:00