diff options
| author | Ben Hamilton <benhamilton@google.com> | 2018-03-22 03:25:22 +0000 | 
|---|---|---|
| committer | Ben Hamilton <benhamilton@google.com> | 2018-03-22 03:25:22 +0000 | 
| commit | 19c782d5200becc61e18922a689f778bf5a1a0cc (patch) | |
| tree | 613c78f80d528d35d9e8a39ebd1510eda41abd3f /clang/unittests | |
| parent | 5f91134344114826644b920d6fd5ec5b88ca47cb (diff) | |
| download | bcm5719-llvm-19c782d5200becc61e18922a689f778bf5a1a0cc.tar.gz bcm5719-llvm-19c782d5200becc61e18922a689f778bf5a1a0cc.zip | |
[clang-format] Add a few more Core Graphics identifiers to ObjC heuristic
Summary:
We received reports of the Objective-C style guesser getting a false
negative on header files like:
CGSize SizeOfThing(MyThing thing);
This adds more Core Graphics identifiers to the Objective-C style
guesser.
Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: jolesiak, djasper
Reviewed By: jolesiak, djasper
Subscribers: krasimir, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D44632
llvm-svn: 328175
Diffstat (limited to 'clang/unittests')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index bdb3fbe4835..400a55827a0 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -12108,6 +12108,12 @@ TEST_F(FormatTest, FileAndCode) {    EXPECT_EQ(FormatStyle::LK_ObjC, guessLanguage("foo.h", "@interface Foo\n@end\n"));    EXPECT_EQ(FormatStyle::LK_Cpp, guessLanguage("foo", ""));    EXPECT_EQ(FormatStyle::LK_ObjC, guessLanguage("foo", "@interface Foo\n@end\n")); +  EXPECT_EQ(FormatStyle::LK_ObjC, +            guessLanguage("foo.h", "int DoStuff(CGRect rect);\n")); +  EXPECT_EQ( +      FormatStyle::LK_ObjC, +      guessLanguage("foo.h", +                    "#define MY_POINT_MAKE(x, y) CGPointMake((x), (y));\n"));  }  TEST_F(FormatTest, GuessLanguageWithCpp11AttributeSpecifiers) { | 

