android_packages_modules_Co.../staticlibs/testutils/hostdevice/com
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Chalard Jean c96d1ae0e6 Move failWithErrorReason to a common place
This is a shared public utility. Its main utility is for methods
that can fail, have an error message of their own, and also want
to take an error message from a caller and want to combine them.
Example useĀ :
fun <T> assertEquals(expected: T, actual: T, msg: String? = null) {
  if (expected != null) {
    failWithErrorReason(msg, "Expected $expected, got $actual")
  }
}
...which allows someone to say
assertEquals(a, b, "Checking a vs b")

Test: TH
Flag: EXEMPT test-only change
Change-Id: Id3eaa8384b4177f38f13576d9b4d742c52027ae4
2025-04-27 15:54:35 +09:00
..
android Move failWithErrorReason to a common place 2025-04-27 15:54:35 +09:00