diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
commit | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (patch) | |
tree | c72b9241553fc9966179aba84f90f17bfa9235c3 /unittests/Format/FormatTestObjC.cpp | |
parent | b52119637f743680a99710ce5fdb6646da2772af (diff) |
Diffstat (limited to 'unittests/Format/FormatTestObjC.cpp')
-rw-r--r-- | unittests/Format/FormatTestObjC.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/unittests/Format/FormatTestObjC.cpp b/unittests/Format/FormatTestObjC.cpp index 6a530f921e6df..680ff92f75e89 100644 --- a/unittests/Format/FormatTestObjC.cpp +++ b/unittests/Format/FormatTestObjC.cpp @@ -68,17 +68,21 @@ protected: FormatStyle Style; }; -TEST_F(FormatTestObjC, DetectsObjCInHeaders) { - Style = getStyle("LLVM", "a.h", "none", "@interface\n" - "- (id)init;"); - EXPECT_EQ(FormatStyle::LK_ObjC, Style.Language); +TEST(FormatTestObjCStyle, DetectsObjCInHeaders) { + auto Style = getStyle("LLVM", "a.h", "none", "@interface\n" + "- (id)init;"); + ASSERT_TRUE((bool)Style); + EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language); + Style = getStyle("LLVM", "a.h", "none", "@interface\n" "+ (id)init;"); - EXPECT_EQ(FormatStyle::LK_ObjC, Style.Language); + ASSERT_TRUE((bool)Style); + EXPECT_EQ(FormatStyle::LK_ObjC, Style->Language); // No recognizable ObjC. Style = getStyle("LLVM", "a.h", "none", "void f() {}"); - EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language); + ASSERT_TRUE((bool)Style); + EXPECT_EQ(FormatStyle::LK_Cpp, Style->Language); } TEST_F(FormatTestObjC, FormatObjCTryCatch) { |