Skip to content
Permalink
Browse files
Fix boolean operation in WTF/BitMap test.
https://bugs.webkit.org/show_bug.cgi?id=240668

Reviewed by Adrian Perez de Castro.

Clang 14 starts complaining about using logical operators to boolean:
```
webkit/Tools/TestWebKitAPI/Tests/WTF/Bitmap.cpp:1172:32: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
        EXPECT_EQ(temp.get(i), bitmap1.get(i) | bitmap2.get(i));
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              ||
```

Canonical link: https://commits.webkit.org/250773@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
basuke committed May 20, 2022
1 parent c89b516 commit 5d22f11f91ceeb9d301d5cb5ef69d6cf82fd8aa3
Showing 1 changed file with 2 additions and 2 deletions.
@@ -1169,7 +1169,7 @@ void testBitmapOperatorBitOrAssignmentImpl(size_t size, const Bitmap& bitmap1, c

temp |= bitmap2;
for (size_t i = 0; i < size; ++i)
EXPECT_EQ(temp.get(i), bitmap1.get(i) | bitmap2.get(i));
EXPECT_EQ(temp.get(i), bitmap1.get(i) || bitmap2.get(i));

temp1 = temp;
EXPECT_TRUE(temp1 == temp);
@@ -1237,7 +1237,7 @@ void testBitmapOperatorBitAndAssignmentImpl(size_t size, const Bitmap& bitmap1,

temp &= bitmap2;
for (size_t i = 0; i < size; ++i)
EXPECT_EQ(temp.get(i), bitmap1.get(i) & bitmap2.get(i));
EXPECT_EQ(temp.get(i), bitmap1.get(i) && bitmap2.get(i));

EXPECT_TRUE(!temp.isEmpty());
temp1 = temp;

0 comments on commit 5d22f11

Please sign in to comment.