From 14b3bf5445ef2e347389fc6a20693a047fdc31b1 Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Mon, 7 Mar 2022 09:50:14 -0800 Subject: [PATCH] Configure alpha as false explicitly on jpeg encode tests Jpeg encoding does not support alpha. PiperOrigin-RevId: 432968779 --- .../bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java index 7600d9e5ea..6eeb0e5c70 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java @@ -42,6 +42,8 @@ public void tearDown() { @Test public void testBitmapIsEncoded() throws IOException { + harness.bitmap.setHasAlpha(false); + assertThat(harness.encode()).isEqualTo(harness.expectedData(CompressFormat.JPEG, 90)); } @@ -49,6 +51,7 @@ public void testBitmapIsEncoded() throws IOException { public void testBitmapIsEncodedWithGivenQuality() throws IOException { int quality = 7; harness.setQuality(quality); + harness.bitmap.setHasAlpha(false); assertThat(harness.encode()).isEqualTo(harness.expectedData(CompressFormat.JPEG, quality)); }