From 84cb38373ecdf26edbf39429cc37e834d2a11447 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Tue, 1 Feb 2022 14:31:48 -0500 Subject: Fix Abseil hash tests on s390x Backport some patches from upstream to make tests pass on big-endian machines. --- debian/patches/std-hash.diff | 46 -------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 debian/patches/std-hash.diff (limited to 'debian/patches/std-hash.diff') diff --git a/debian/patches/std-hash.diff b/debian/patches/std-hash.diff deleted file mode 100644 index 52096742..00000000 --- a/debian/patches/std-hash.diff +++ /dev/null @@ -1,46 +0,0 @@ -From: Benjamin Barenblat -Subject: Work around broken std::hash on s390x -Forwarded: no -Bug-Debian: https://bugs.debian.org/977638 - -On s390x, std::hash hashes large classes of data to the same value, which -violates assumptions made by the Abseil tests. #ifdef out the test code that -depends on those assumptions. - ---- a/absl/hash/hash_test.cc -+++ b/absl/hash/hash_test.cc -@@ -358,6 +358,8 @@ - TEST(HashValueTest, StdBitset) { - EXPECT_TRUE((is_hashable>::value)); - -+ // The following assertions fail on s390x (https://bugs.debian.org/977638). -+#ifndef __s390x__ - EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly( - {std::bitset<2>("00"), std::bitset<2>("01"), std::bitset<2>("10"), - std::bitset<2>("11")})); -@@ -379,6 +381,7 @@ - std::bitset(bit_strings[3].c_str()), - std::bitset(bit_strings[4].c_str()), - std::bitset(bit_strings[5].c_str())})); -+#endif - } // namespace - - template -@@ -400,10 +403,15 @@ - } - - REGISTER_TYPED_TEST_CASE_P(HashValueSequenceTest, BasicUsage); -+// std::vector tests fail on s390x, so exclude them. See -+// https://bugs.debian.org/977638. - using IntSequenceTypes = - testing::Types, std::forward_list, std::list, -- std::vector, std::vector, std::set, -- std::multiset>; -+ std::vector, -+#ifndef __s390x__ -+ std::vector, -+#endif -+ std::set, std::multiset>; - INSTANTIATE_TYPED_TEST_CASE_P(My, HashValueSequenceTest, IntSequenceTypes); - - // Private type that only supports AbslHashValue to make sure our chosen hash -- cgit v1.2.3