[clang] 02362b1 - [clang-format] Check token size in QualifierFixerTest.cpp
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 9 02:14:59 PST 2024
Author: Owen Pan
Date: 2024-02-09T02:14:50-08:00
New Revision: 02362b1ad1c07a01714b195d769400dd40dbfd04
URL: https://github.com/llvm/llvm-project/commit/02362b1ad1c07a01714b195d769400dd40dbfd04
DIFF: https://github.com/llvm/llvm-project/commit/02362b1ad1c07a01714b195d769400dd40dbfd04.diff
LOG: [clang-format] Check token size in QualifierFixerTest.cpp
Added:
Modified:
clang/unittests/Format/QualifierFixerTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp
index 324366ca7f5e5..0aa755acfc821 100644
--- a/clang/unittests/Format/QualifierFixerTest.cpp
+++ b/clang/unittests/Format/QualifierFixerTest.cpp
@@ -1055,6 +1055,7 @@ TEST_F(QualifierFixerTest, IsQualifierType) {
auto Tokens = annotate(
"const static inline auto restrict int double long constexpr friend");
+ ASSERT_EQ(Tokens.size(), 11u) << Tokens;
EXPECT_TRUE(LeftRightQualifierAlignmentFixer::isConfiguredQualifierOrType(
Tokens[0], ConfiguredTokens));
@@ -1089,6 +1090,7 @@ TEST_F(QualifierFixerTest, IsQualifierType) {
EXPECT_TRUE(LeftRightQualifierAlignmentFixer::isQualifierOrType(Tokens[9]));
auto NotTokens = annotate("for while do Foo Bar ");
+ ASSERT_EQ(NotTokens.size(), 6u) << Tokens;
EXPECT_FALSE(LeftRightQualifierAlignmentFixer::isConfiguredQualifierOrType(
NotTokens[0], ConfiguredTokens));
@@ -1120,6 +1122,7 @@ TEST_F(QualifierFixerTest, IsQualifierType) {
TEST_F(QualifierFixerTest, IsMacro) {
auto Tokens = annotate("INT INTPR Foo int");
+ ASSERT_EQ(Tokens.size(), 5u) << Tokens;
EXPECT_TRUE(LeftRightQualifierAlignmentFixer::isPossibleMacro(Tokens[0]));
EXPECT_TRUE(LeftRightQualifierAlignmentFixer::isPossibleMacro(Tokens[1]));
More information about the cfe-commits
mailing list