From b51c0228e6403e6e5a3aa4a03b3c53f90d78b3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:36:42 -0700 Subject: [PATCH] Hardcode the integers instead of converting the ZLibNative values, as the Brotli test project also inherits and uses this test. --- .../IO/Compression/CompressionStreamUnitTestBase.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs index 23a3f7dd84d2d0..a6635777f85832 100644 --- a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs +++ b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs @@ -513,13 +513,10 @@ async Task GetLengthAsync(int compressionLevel) return mms.Length; } - // Avoid comparing compression level numbers that are too close to each other, as for those cases the expected file size difference cannot be guaranteed - long noCompressionLength = await GetLengthAsync((int)ZLibNative.CompressionLevel.NoCompression); - long fastestLength = await GetLengthAsync((int)ZLibNative.CompressionLevel.BestSpeed); - long optimalLength = await GetLengthAsync((int)ZLibNative.CompressionLevel.DefaultCompression); - long smallestLength = await GetLengthAsync((int)ZLibNative.CompressionLevel.BestCompression); + long fastestLength = await GetLengthAsync(1); + long optimalLength = await GetLengthAsync(5); + long smallestLength = await GetLengthAsync(9); - Assert.True(noCompressionLength >= fastestLength); Assert.True(fastestLength >= optimalLength); Assert.True(optimalLength >= smallestLength); }