Skip to content

Commit

Permalink
Increase threshold for stuck bits in PointerAlignment test on android.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 710848950
Change-Id: If24a0b1b28fafa884be9deda79f4cd48488193c9
  • Loading branch information
ezbr authored and copybara-github committed Dec 31, 2024
1 parent 86c7331 commit f339ea3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion absl/hash/hash_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,13 @@ TEST(HashValueTest, PointerAlignment) {
size_t stuck_bits = (~bits_or | bits_and) & kMask;
// Test that there are less than 3 stuck bits. Sometimes we see stuck_bits
// of 0x3.
EXPECT_LT(absl::popcount(stuck_bits), 3) << "0x" << std::hex << stuck_bits;
size_t stuck_bits_threshold = 3;
#ifdef __ANDROID__
// On Android, we sometimes see stuck_bits of 0x780 when align is 11520.
stuck_bits_threshold = 5;
#endif
EXPECT_LT(absl::popcount(stuck_bits), stuck_bits_threshold)
<< "0x" << std::hex << stuck_bits;
}
}
#endif // !defined(ABSL_HAVE_ADDRESS_SANITIZER) && !defined(__APPLE__)
Expand Down

0 comments on commit f339ea3

Please sign in to comment.