From 47e26b2ed8639810fbed20391eeaa246e46f68f5 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 2 Dec 2022 07:08:23 -0500 Subject: [PATCH] Fix NonCryptoHashTestDriver.AssertEqualHashNumber for big endian (#79135) Fix https://github.com/dotnet/runtime/pull/78075#issuecomment-1325487302 --- .../System.IO.Hashing/tests/NonCryptoHashTestDriver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs index 2342f5c3916b5..f2d8e411533ec 100644 --- a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs +++ b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs @@ -297,7 +297,7 @@ private void VerifyEmptyResult(ReadOnlySpan result) protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEndian = false) { - if (littleEndian == BitConverter.IsLittleEndian) + if (littleEndian) { hash = BinaryPrimitives.ReverseEndianness(hash); } @@ -306,7 +306,7 @@ protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEn protected static void AssertEqualHashNumber(string hex, ulong hash, bool littleEndian = false) { - if (littleEndian == BitConverter.IsLittleEndian) + if (littleEndian) { hash = BinaryPrimitives.ReverseEndianness(hash); }