Merge "FontScaleConverterFactoryTest: 15x perf increase" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6e374e9b21
@@ -132,9 +132,13 @@ class FontScaleConverterFactoryTest {
|
|||||||
}
|
}
|
||||||
.forEach { (table, sp) ->
|
.forEach { (table, sp) ->
|
||||||
try {
|
try {
|
||||||
assertWithMessage("convertSpToDp(%s) on table: %s", sp, table)
|
// Truth is slow because it creates a bunch of
|
||||||
.that(table.convertSpToDp(sp))
|
// objects. Don't use it unless we need to.
|
||||||
.isFinite()
|
if (!table.convertSpToDp(sp).isFinite()) {
|
||||||
|
assertWithMessage("convertSpToDp(%s) on table: %s", sp, table)
|
||||||
|
.that(table.convertSpToDp(sp))
|
||||||
|
.isFinite()
|
||||||
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
throw AssertionError("Exception during convertSpToDp($sp) on table: $table", e)
|
throw AssertionError("Exception during convertSpToDp($sp) on table: $table", e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user