summaryrefslogtreecommitdiff
path: root/absl/random/internal/randen_slow_test.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-02-07 17:35:10 -0800
committerGravatar Derek Mauro <dmauro@google.com>2021-02-08 13:24:45 -0500
commitc36d825d9a5443f81d2656685ae021d6326da90c (patch)
treeda1bc21f837193a9a763132d219afa84aa74cead /absl/random/internal/randen_slow_test.cc
parent9c6a50fdd80bb39fabd95faeda84f04062685ff3 (diff)
Export of internal Abseil changes
-- 756156bf03da050e8b27539a8247d9af7e44c6a2 by Abseil Team <absl-team@google.com>: Fix a typo in cord.h: "accomodate" => "accommodate" PiperOrigin-RevId: 356168875 -- 638befdb342b608ec28910ee931ee200fdbe1fef by Samuel Benzaquen <sbenza@google.com>: Fix float conversion for PPC. In PPC `long double` is a double-double representation which behaves weirdly wrt numeric_limits. Don't take `long double` into account when we are not handling `long double` natively anyway. Fix the convert test to always run the conversion even if we are not going to compare against libc's printf result. This allows exercising the code itself to make sure we don't trigger assertions or UB found by sanitizers. PiperOrigin-RevId: 355857729 -- ff5f893319fa76b273c7785b76ef6c95b1791076 by Abseil Team <absl-team@google.com>: Example usage tweak PiperOrigin-RevId: 355695750 -- 0efc454f90023fa651b226e5e3ba7395a3b60c6d by Benjamin Barenblat <bbaren@google.com>: Remove endian-sensitivity from Abseil’s RNG Ensure that the Abseil random number generator produces identical output on both big- and little-endian platforms by byte-swapping appropriately on big-endian systems. PiperOrigin-RevId: 355635051 GitOrigin-RevId: 756156bf03da050e8b27539a8247d9af7e44c6a2 Change-Id: Iaaa69767b8e85d626742b9ba56fefb75f07c69ee
Diffstat (limited to 'absl/random/internal/randen_slow_test.cc')
-rw-r--r--absl/random/internal/randen_slow_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/random/internal/randen_slow_test.cc b/absl/random/internal/randen_slow_test.cc
index 4a535837..4861ffa4 100644
--- a/absl/random/internal/randen_slow_test.cc
+++ b/absl/random/internal/randen_slow_test.cc
@@ -17,6 +17,7 @@
#include <cstring>
#include "gtest/gtest.h"
+#include "absl/base/internal/endian.h"
#include "absl/random/internal/randen_traits.h"
namespace {
@@ -56,7 +57,7 @@ TEST(RandenSlowTest, Default) {
uint64_t* id = d.state;
for (const auto& elem : kGolden) {
- EXPECT_EQ(elem, *id++);
+ EXPECT_EQ(absl::little_endian::FromHost64(elem), *id++);
}
}