Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Nov 18, 2024
1 parent fcc1daa commit 86fc230
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ internal suspend fun transform(

// Skip the transformations as converting to a bitmap is disabled.
val image = result.image
if (image is BitmapImage && !request.allowConversionToBitmap) {
if (image !is BitmapImage && !request.allowConversionToBitmap) {
logger?.log(TAG, Logger.Level.Info) {
val type = result.image::class.simpleName
"allowConversionToBitmap=false, skipping transformations for type $type."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ internal actual fun convertImageToBitmap(
): Bitmap {
if (image is BitmapImage) {
return image.bitmap
} else {
error(
"Converting image of type ${image::class.simpleName} " +
"to apply transformations: $transformations is not currently supported." +
"Set ImageRequest.Builder.allowConversionToBitmap(false) to skip applying these " +
"transformations."
)
}

error(
"Converting image of type ${image::class.simpleName} " +
"to apply transformations: $transformations is not currently supported." +
"Set ImageRequest.Builder.allowConversionToBitmap(false) to skip applying these " +
"transformations."
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AnimatedAndNormalTransformationTest {
assertIs<SuccessResult>(actual)
// Make sure this is not an animated result.
assertIsNot<Animatable>(actual.image.asDrawable(context.resources))
(actual.image as BitmapImage).bitmap.assertIsSimilarTo(expected)
assertIs<BitmapImage>(actual.image).bitmap.assertIsSimilarTo(expected)
}

class AnimatedCircleTransformation : AnimatedTransformation {
Expand Down

0 comments on commit 86fc230

Please sign in to comment.