Skip to content

Commit f2099c5

Browse files
committed
[BitmapUtils] Change: Add more cover to findCropPosition()
1 parent bf92eab commit f2099c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

photomanipulator/src/androidTest/java/com/guhungry/photomanipulator/BitmapUtilsAndroidTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ internal class BitmapUtilsAndroidTest {
4343
@Test
4444
fun cropAndResize_when_portrait_should_have_correct_size() {
4545
FileUtils.openBitmapInputStream(TestHelper.context(), TestHelper.drawableUri(R.drawable.background)).use {
46-
output = BitmapUtils.cropAndResize(it, CGRect(79, 45, 32, 96), CGSize(16, 48), BitmapFactory.Options())
46+
output = BitmapUtils.cropAndResize(it, CGRect(79, 45, 32, 96), CGSize(19, 48), BitmapFactory.Options())
4747

48-
assertThat(output!!.width, equalTo(16))
48+
assertThat(output!!.width, equalTo(19))
4949
assertThat(output!!.height, equalTo(48))
5050
}
5151
}
5252

5353
@Test
5454
fun cropAndResize_when_landscaape_should_have_correct_size() {
5555
FileUtils.openBitmapInputStream(TestHelper.context(), TestHelper.drawableUri(R.drawable.background)).use {
56-
output = BitmapUtils.cropAndResize(it, CGRect(79, 45, 32, 96), CGSize(48, 17), BitmapFactory.Options())
56+
output = BitmapUtils.cropAndResize(it, CGRect(79, 45, 32, 96), CGSize(15, 48), BitmapFactory.Options())
5757

58-
assertThat(output!!.width, equalTo(48))
59-
assertThat(output!!.height, equalTo(17))
58+
assertThat(output!!.width, equalTo(15))
59+
assertThat(output!!.height, equalTo(48))
6060
}
6161
}
6262

0 commit comments

Comments
 (0)