Skip to content

Commit

Permalink
Hardcode the integers instead of converting the ZLibNative values, as…
Browse files Browse the repository at this point in the history
… the Brotli test project also inherits and uses this test.
  • Loading branch information
carlossanlop committed Aug 26, 2024
1 parent 98fc780 commit b51c022
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,10 @@ async Task<long> 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);
}
Expand Down

0 comments on commit b51c022

Please sign in to comment.