Skip to content

Commit

Permalink
Add regression test for RequestService setting bitmap config.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Apr 29, 2024
1 parent 92ba8b2 commit 6df3edd
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,16 @@ class RequestServiceTest : RobolectricTest() {
val options = service.options(request, Size(100, 100))
assertEquals(Bitmap.Config.RGB_565, options.bitmapConfig)
}

/** Regression test: https://github.com/coil-kt/coil/issues/2221 */
@Test
@Config(sdk = [30])
fun `bitmapConfig is preserved if hardware bitmaps are enabled`() {
val request = ImageRequest.Builder(context)
.data(Unit)
.bitmapConfig(Bitmap.Config.RGB_565)
.build()
val options = service.options(request, Size(100, 100))
assertEquals(Bitmap.Config.RGB_565, options.bitmapConfig)
}
}

0 comments on commit 6df3edd

Please sign in to comment.